pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Support multi-stage aggregation.
Date: Wed, 20 Jan 2016 19:06:39 +0000
Message-ID: <E1aLy5X-0002Px-Ga@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a7de3dc5c346e07e0439275982569996e645b3c2

Modified Files
--------------
doc/src/sgml/ref/create_aggregate.sgml         |   16 +-
src/backend/catalog/pg_aggregate.c             |   38 ++-
src/backend/commands/aggregatecmds.c           |    4 +
src/backend/commands/explain.c                 |   46 ++--
src/backend/executor/nodeAgg.c                 |  333 ++++++++++++++++++++----
src/backend/nodes/copyfuncs.c                  |    2 +
src/backend/nodes/outfuncs.c                   |    3 +
src/backend/nodes/readfuncs.c                  |    2 +
src/backend/optimizer/plan/createplan.c        |    9 +-
src/backend/optimizer/plan/planner.c           |    8 +
src/backend/optimizer/prep/prepunion.c         |    2 +
src/backend/parser/parse_agg.c                 |   36 +++
src/bin/pg_dump/pg_dump.c                      |   30 ++-
src/include/catalog/catversion.h               |    2 +-
src/include/catalog/pg_aggregate.h             |  306 +++++++++++-----------
src/include/nodes/execnodes.h                  |    2 +
src/include/nodes/plannodes.h                  |    2 +
src/include/optimizer/planmain.h               |    5 +-
src/include/parser/parse_agg.h                 |    5 +
src/test/regress/expected/create_aggregate.out |   18 ++
src/test/regress/sql/create_aggregate.sql      |   17 ++
21 files changed, 652 insertions(+), 234 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1aLy5X-0002Px-Ga@gemulon.postgresql.org>
Permalink:  ../E1aLy5X-0002Px-Ga@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aLy5X-0002Px-Ga@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Support multi-stage aggregation.
  In-Reply-To: <E1aLy5X-0002Px-Ga@gemulon.postgresql.org>
  References: <E1aLy5X-0002Px-Ga@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox