diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-03-21 09:20:53 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-03-21 09:30:18 -0400 |
commit | e06a38965b3bcdaa881e7e06892d4d8ab6c2c980 (patch) | |
tree | 7fe176a2301090c3bec08999ff77b8d0ab90fabe /src/backend/executor/execQual.c | |
parent | 7fa0064092e135415a558dc3c4d7393d14ab6d8e (diff) | |
download | postgresql-e06a38965b3bcdaa881e7e06892d4d8ab6c2c980.tar.gz postgresql-e06a38965b3bcdaa881e7e06892d4d8ab6c2c980.zip |
Support parallel aggregation.
Parallel workers can now partially aggregate the data and pass the
transition values back to the leader, which can combine the partial
results to produce the final answer.
David Rowley, based on earlier work by Haribabu Kommi. Reviewed by
Álvaro Herrera, Tomas Vondra, Amit Kapila, James Sewell, and me.
Diffstat (limited to 'src/backend/executor/execQual.c')
-rw-r--r-- | src/backend/executor/execQual.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index 778b6c1552f..4df4a9b0f7d 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -4515,6 +4515,14 @@ ExecInitExpr(Expr *node, PlanState *parent) if (parent && IsA(parent, AggState)) { AggState *aggstate = (AggState *) parent; + Aggref *aggref = (Aggref *) node; + + if (aggstate->finalizeAggs && + aggref->aggoutputtype != aggref->aggtype) + { + /* planner messed up */ + elog(ERROR, "Aggref aggoutputtype must match aggtype"); + } aggstate->aggs = lcons(astate, aggstate->aggs); aggstate->numaggs++; |