diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-12-23 13:39:42 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-12-23 13:41:06 -0500 |
commit | 51d152f18e124cc07c293756cc16014ba218b2df (patch) | |
tree | 9f49e9e9f097879d02a430c2b9b72206d1d31882 /src | |
parent | 30c0c4bf12cc56a7a6c2b7f874e2cd4c95cd3491 (diff) | |
download | postgresql-51d152f18e124cc07c293756cc16014ba218b2df.tar.gz postgresql-51d152f18e124cc07c293756cc16014ba218b2df.zip |
Change Gather not to use a physical tlist.
This should have been part of the original commit, but was missed.
Pushing data between processes is expensive, so we definitely want
to project away unneeded columns here, just as we do for other nodes
like Sort and Hash that care about the volume of data.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 32f903d8dca..01209aa3288 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -558,7 +558,8 @@ use_physical_tlist(PlannerInfo *root, RelOptInfo *rel) * If the plan node immediately above a scan would prefer to get only * needed Vars and not a physical tlist, it must call this routine to * undo the decision made by use_physical_tlist(). Currently, Hash, Sort, - * and Material nodes want this, so they don't have to store useless columns. + * Material, and Gather nodes want this, so they don't have to store or + * transfer useless columns. */ static void disuse_physical_tlist(PlannerInfo *root, Plan *plan, Path *path) @@ -1123,6 +1124,8 @@ create_gather_plan(PlannerInfo *root, GatherPath *best_path) subplan = create_plan_recurse(root, best_path->subpath); + disuse_physical_tlist(root, subplan, best_path->subpath); + gather_plan = make_gather(subplan->targetlist, NIL, best_path->num_workers, |