Skip to content

Commit e89f14e

Browse files
committed
Refactor index cost estimation functions in view of IndexClause changes.
Get rid of deconstruct_indexquals() in favor of just iterating over the IndexClause list directly. The extra services that that function used to provide, such as hiding clause commutation and associating the right index column with each clause, are no longer useful given the new data structure. I'd originally thought that it'd provide a useful amount of abstraction by freeing callers from paying attention to the exact clause type of each indexqual, but that hope proves to have been vain, because few callers can ignore the semantic differences between different clause types. Indeed, removing it results in a net code savings, and probably some cycles shaved by not having to build an extra list-of-structs data structure. Also, export a few formerly-static support functions, with the goal of allowing extension AMs to write functionality equivalent to genericcostestimate() without pointless code duplication. Discussion: https://postgr.es/m/24586.1550106354@sss.pgh.pa.us
1 parent fc6c727 commit e89f14e

File tree

3 files changed

+172
-233
lines changed

3 files changed

+172
-233
lines changed

contrib/bloom/blcost.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@ blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
2727
double *indexPages)
2828
{
2929
IndexOptInfo *index = path->indexinfo;
30-
List *qinfos;
3130
GenericCosts costs;
3231

33-
/* Do preliminary analysis of indexquals */
34-
qinfos = deconstruct_indexquals(path);
35-
3632
MemSet(&costs, 0, sizeof(costs));
3733

3834
/* We have to visit all index tuples anyway */
3935
costs.numIndexTuples = index->tuples;
4036

4137
/* Use generic estimate */
42-
genericcostestimate(root, path, loop_count, qinfos, &costs);
38+
genericcostestimate(root, path, loop_count, &costs);
4339

4440
*indexStartupCost = costs.indexStartupCost;
4541
*indexTotalCost = costs.indexTotalCost;

0 commit comments

Comments
 (0)