diff options
Diffstat (limited to 'src/backend/optimizer/prep/prepagg.c')
-rw-r--r-- | src/backend/optimizer/prep/prepagg.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/optimizer/prep/prepagg.c b/src/backend/optimizer/prep/prepagg.c index 5b12937eada..da89b55402c 100644 --- a/src/backend/optimizer/prep/prepagg.c +++ b/src/backend/optimizer/prep/prepagg.c @@ -225,6 +225,7 @@ preprocess_aggref(Aggref *aggref, PlannerInfo *root) { AggInfo *agginfo = list_nth_node(AggInfo, root->agginfos, aggno); + agginfo->aggrefs = lappend(agginfo->aggrefs, aggref); transno = agginfo->transno; } else @@ -232,7 +233,7 @@ preprocess_aggref(Aggref *aggref, PlannerInfo *root) AggInfo *agginfo = makeNode(AggInfo); agginfo->finalfn_oid = aggfinalfn; - agginfo->representative_aggref = aggref; + agginfo->aggrefs = list_make1(aggref); agginfo->shareable = shareable; aggno = list_length(root->agginfos); @@ -386,7 +387,7 @@ find_compatible_agg(PlannerInfo *root, Aggref *newagg, aggno++; - existingRef = agginfo->representative_aggref; + existingRef = linitial_node(Aggref, agginfo->aggrefs); /* all of the following must be the same or it's no match */ if (newagg->inputcollid != existingRef->inputcollid || @@ -648,7 +649,7 @@ get_agg_clause_costs(PlannerInfo *root, AggSplit aggsplit, AggClauseCosts *costs foreach(lc, root->agginfos) { AggInfo *agginfo = lfirst_node(AggInfo, lc); - Aggref *aggref = agginfo->representative_aggref; + Aggref *aggref = linitial_node(Aggref, agginfo->aggrefs); /* * Add the appropriate component function execution costs to |