summaryrefslogtreecommitdiff
path: root/src/include/parser
diff options
context:
space:
mode:
authorRobert Haas2016-01-20 18:46:50 +0000
committerRobert Haas2016-01-20 18:46:50 +0000
commita7de3dc5c346e07e0439275982569996e645b3c2 (patch)
tree9d47c8729c497aeff82b196ddf5f85f478c2a21d /src/include/parser
parentc8642d909fdd57c36dd71e0b0bb4071523324794 (diff)
Support multi-stage aggregation.
Aggregate nodes now have two new modes: a "partial" mode where they output the unfinalized transition state, and a "finalize" mode where they accept unfinalized transition states rather than individual values as input. These new modes are not used anywhere yet, but they will be necessary for parallel aggregation. The infrastructure also figures to be useful for cases where we want to aggregate local data and remote data via the FDW interface, and want to bring back partial aggregates from the remote side that can then be combined with locally generated partial aggregates to produce the final value. It may also be useful even when neither FDWs nor parallelism are in play, as explained in the comments in nodeAgg.c. David Rowley and Simon Riggs, reviewed by KaiGai Kohei, Heikki Linnakangas, Haribabu Kommi, and me.
Diffstat (limited to 'src/include/parser')
-rw-r--r--src/include/parser/parse_agg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index 3e336b93729..699b61c528e 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -46,6 +46,11 @@ extern void build_aggregate_transfn_expr(Oid *agg_input_types,
Expr **transfnexpr,
Expr **invtransfnexpr);
+extern void build_aggregate_combinefn_expr(Oid agg_state_type,
+ Oid agg_input_collation,
+ Oid combinefn_oid,
+ Expr **combinefnexpr);
+
extern void build_aggregate_finalfn_expr(Oid *agg_input_types,
int num_finalfn_inputs,
Oid agg_state_type,