Skip to content

Commit 0ee92e1

Browse files
committed
Fix a couple of planner bugs in Gather Merge.
Neha Sharma reported these to Rushabh Lathia just after I commit 355d399 went in. The patch is Rushabh's, with input from me.
1 parent cd603a4 commit 0ee92e1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backend/optimizer/plan/createplan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,13 +1474,14 @@ create_gather_merge_plan(PlannerInfo *root, GatherMergePath *best_path)
14741474
Oid *sortOperators;
14751475
Oid *collations;
14761476
bool *nullsFirst;
1477+
List *tlist = build_path_tlist(root, &best_path->path);
14771478

14781479
/* As with Gather, it's best to project away columns in the workers. */
14791480
subplan = create_plan_recurse(root, best_path->subpath, CP_EXACT_TLIST);
14801481

14811482
/* See create_merge_append_plan for why there's no make_xxx function */
14821483
gm_plan = makeNode(GatherMerge);
1483-
gm_plan->plan.targetlist = subplan->targetlist;
1484+
gm_plan->plan.targetlist = tlist;
14841485
gm_plan->num_workers = best_path->num_workers;
14851486
copy_generic_path_info(&gm_plan->plan, &best_path->path);
14861487

src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3746,7 +3746,7 @@ create_grouping_paths(PlannerInfo *root,
37463746
create_gather_merge_path(root,
37473747
grouped_rel,
37483748
subpath,
3749-
NULL,
3749+
partial_grouping_target,
37503750
root->group_pathkeys,
37513751
NULL,
37523752
&total_groups);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy