From 59eb55127906b943ff155240eebc161df8edb62f Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 27 Apr 2016 07:33:33 -0400 Subject: Fix EXPLAIN VERBOSE output for parallel aggregate. The way that PartialAggregate and FinalizeAggregate plan nodes were displaying output columns before was bogus. Now, FinalizeAggregate produces the same outputs as an Aggregate would have produced, while PartialAggregate produces each of those outputs prefixed by the word PARTIAL. Discussion: 12585.1460737650@sss.pgh.pa.us Patch by me, reviewed by David Rowley. --- src/backend/optimizer/plan/setrefs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/backend/optimizer/plan/setrefs.c') diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 5537c147ad9..266e83055b2 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -2100,6 +2100,10 @@ search_indexed_tlist_for_partial_aggref(Aggref *aggref, indexed_tlist *itlist, continue; if (aggref->aggvariadic != tlistaggref->aggvariadic) continue; + /* + * it would be harmless to compare aggcombine and aggpartial, but + * it's also unnecessary + */ if (aggref->aggkind != tlistaggref->aggkind) continue; if (aggref->agglevelsup != tlistaggref->agglevelsup) @@ -2463,6 +2467,7 @@ fix_combine_agg_expr_mutator(Node *node, fix_upper_expr_context *context) newtle = makeTargetEntry((Expr *) newvar, 1, NULL, false); newaggref = (Aggref *) copyObject(aggref); newaggref->args = list_make1(newtle); + newaggref->aggcombine = true; return (Node *) newaggref; } -- cgit v1.2.3