aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-01-12 22:35:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-01-12 22:35:29 +0000
commitd4ce5a4f4c3516e88fa34c53bcc7313db90a3c08 (patch)
tree4c6b53e1c1e0989a9f45fe42ab6f29ffac019c03 /src/backend/utils/adt/selfuncs.c
parentd51260aa9d36653f4d63e6df133ddff8380f61b2 (diff)
downloadpostgresql-d4ce5a4f4c3516e88fa34c53bcc7313db90a3c08.tar.gz
postgresql-d4ce5a4f4c3516e88fa34c53bcc7313db90a3c08.zip
Revise cost_qual_eval() to compute both startup (one-time) and per-tuple
costs for expression evaluation, not only per-tuple cost as before. This extension is needed in order to deal realistically with hashed or materialized sub-selects.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r--src/backend/utils/adt/selfuncs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 58c63c210cc..977cbe0a5e4 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.124 2002/12/17 01:18:35 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.125 2003/01/12 22:35:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3757,6 +3757,7 @@ genericcostestimate(Query *root, RelOptInfo *rel,
{
double numIndexTuples;
double numIndexPages;
+ QualCost index_qual_cost;
List *selectivityQuals = indexQuals;
/*
@@ -3826,9 +3827,10 @@ genericcostestimate(Query *root, RelOptInfo *rel,
* tuple. All the costs are assumed to be paid incrementally during
* the scan.
*/
- *indexStartupCost = 0;
+ cost_qual_eval(&index_qual_cost, indexQuals);
+ *indexStartupCost = index_qual_cost.startup;
*indexTotalCost = numIndexPages +
- (cpu_index_tuple_cost + cost_qual_eval(indexQuals)) * numIndexTuples;
+ (cpu_index_tuple_cost + index_qual_cost.per_tuple) * numIndexTuples;
/*
* Generic assumption about index correlation: there isn't any.