From: Tom Lane Date: Fri, 27 Feb 2004 21:44:44 +0000 (+0000) Subject: genericcostestimate() neglected to include qual startup cost in X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=a06db31bc6b4ce4b25aaec65ce541e2d6d3d62cf;p=users%2Fbernd%2Fpostgres.git genericcostestimate() neglected to include qual startup cost in indexTotalCost. I think this may not make any real difference in 7.4, but it definitely is a problem with CVS tip's new equation. --- diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 59ef66bace..ddede1d654 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -3977,7 +3977,7 @@ genericcostestimate(Query *root, RelOptInfo *rel, */ cost_qual_eval(&index_qual_cost, indexQuals); *indexStartupCost = index_qual_cost.startup; - *indexTotalCost = numIndexPages + + *indexTotalCost = numIndexPages + index_qual_cost.startup + (cpu_index_tuple_cost + index_qual_cost.per_tuple) * numIndexTuples; /*