diff options
| author | Tom Lane | 2007-09-22 21:36:40 +0000 |
|---|---|---|
| committer | Tom Lane | 2007-09-22 21:36:40 +0000 |
| commit | 71256875114c8c51ac9f36841943ab654f50b646 (patch) | |
| tree | 3ec457b595953e5e485130df2020166ea64f0077 /src/include/optimizer | |
| parent | 576b8903f75285467f40fba7bed5fab0667d39ba (diff) | |
Fix cost estimates for EXISTS subqueries that are evaluated as initPlans
(because they are uncorrelated with the immediate parent query). We were
charging the full run cost to the parent node, disregarding the fact that
only one row need be fetched for EXISTS. While this would only be a
cosmetic issue in most cases, it might possibly affect planning outcomes
if the parent query were itself a subquery to some upper query.
Per recent discussion with Steve Crawford.
Diffstat (limited to 'src/include/optimizer')
| -rw-r--r-- | src/include/optimizer/cost.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index dc052dcf55f..22034850148 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.88 2007/07/25 12:22:53 mha Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.89 2007/09/22 21:36:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -92,6 +92,7 @@ extern void cost_mergejoin(MergePath *path, PlannerInfo *root); extern void cost_hashjoin(HashPath *path, PlannerInfo *root); extern void cost_qual_eval(QualCost *cost, List *quals, PlannerInfo *root); extern void cost_qual_eval_node(QualCost *cost, Node *qual, PlannerInfo *root); +extern Cost get_initplan_cost(PlannerInfo *root, SubPlan *subplan); extern void set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel); extern void set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel, RelOptInfo *outer_rel, |
