diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-30 05:21:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-30 05:21:03 +0000 |
commit | 935969415a90065d4bc4b2643b4c9c50518c934b (patch) | |
tree | 49488aee7f8c95a338e4b53024d4aaeb36d2abcc /src/backend/optimizer/plan/subselect.c | |
parent | 829cedc8cf04801c8fce49afa5dd57b3833b969f (diff) | |
download | postgresql-935969415a90065d4bc4b2643b4c9c50518c934b.tar.gz postgresql-935969415a90065d4bc4b2643b4c9c50518c934b.zip |
Be more realistic about plans involving Materialize nodes: take their
cost into account while planning.
Diffstat (limited to 'src/backend/optimizer/plan/subselect.c')
-rw-r--r-- | src/backend/optimizer/plan/subselect.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index 61476a65604..e4bbd29105e 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.57 2002/11/30 00:08:18 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.58 2002/11/30 05:21:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -328,9 +328,17 @@ make_subplan(SubLink *slink) if (use_material) { Plan *matplan; + Path matpath; /* dummy for result of cost_material */ matplan = (Plan *) make_material(plan->targetlist, plan); - /* kluge --- see comments above */ + /* need to calculate costs */ + cost_material(&matpath, + plan->total_cost, + plan->plan_rows, + plan->plan_width); + matplan->startup_cost = matpath.startup_cost; + matplan->total_cost = matpath.total_cost; + /* parameter kluge --- see comments above */ matplan->extParam = listCopy(plan->extParam); matplan->locParam = listCopy(plan->locParam); node->plan = plan = matplan; |