pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Support hashed aggregation with grouping sets.
3+ messages / 3 participants
[nested] [flat]

* pgsql: Support hashed aggregation with grouping sets.
@ 2017-03-27 03:47  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 2 replies; 3+ messages in thread

From: Andrew Gierth @ 2017-03-27 03:47 UTC (permalink / raw)
  To: pgsql-committers

Support hashed aggregation with grouping sets.

This extends the Aggregate node with two new features: HashAggregate
can now run multiple hashtables concurrently, and a new strategy
MixedAggregate populates hashtables while doing sorted grouping.

The planner will now attempt to save as many sorts as possible when
planning grouping sets queries, while not exceeding work_mem for the
estimated combined sizes of all hashtables used.  No SQL-level changes
are required.  There should be no user-visible impact other than the
new EXPLAIN output and possible changes to result ordering when ORDER
BY was not used (which affected a few regression tests).  The
enable_hashagg option is respected.

Author: Andrew Gierth
Reviewers: Mark Dilger, Andres Freund
Discussion: https://postgr.es/m/87vatszyhj.fsf@news-spur.riddles.org.uk

Branch
------
master

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

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out |  61 +-
src/backend/commands/explain.c                 |  25 +-
src/backend/executor/nodeAgg.c                 | 861 +++++++++++++++++--------
src/backend/lib/Makefile                       |   4 +-
src/backend/lib/knapsack.c                     | 114 ++++
src/backend/nodes/bitmapset.c                  |  30 +
src/backend/nodes/outfuncs.c                   |  34 +-
src/backend/optimizer/path/costsize.c          |   7 +-
src/backend/optimizer/plan/createplan.c        |  83 +--
src/backend/optimizer/plan/planner.c           | 861 ++++++++++++++++++++-----
src/backend/optimizer/util/pathnode.c          | 150 +++--
src/include/lib/knapsack.h                     |  17 +
src/include/nodes/bitmapset.h                  |   6 +
src/include/nodes/execnodes.h                  |  21 +-
src/include/nodes/nodes.h                      |   5 +-
src/include/nodes/plannodes.h                  |   2 +-
src/include/nodes/relation.h                   |  30 +-
src/include/optimizer/pathnode.h               |   4 +-
src/test/regress/expected/groupingsets.out     | 616 +++++++++++++++++-
src/test/regress/expected/tsrf.out             |  50 +-
src/test/regress/sql/groupingsets.sql          | 155 ++++-
src/test/regress/sql/tsrf.sql                  |   2 +
22 files changed, 2544 insertions(+), 594 deletions(-)


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


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Support hashed aggregation with grouping sets.
@ 2017-03-27 04:37  Andrew Gierth <andrew@tao11.riddles.org.uk>
  parent: Andrew Gierth <rhodiumtoad@postgresql.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Andrew Gierth @ 2017-03-27 04:37 UTC (permalink / raw)
  To: Andrew Gierth <rhodiumtoad@postgresql.org>; +Cc: pgsql-committers

>>>>> "Andrew" == Andrew Gierth <rhodiumtoad@postgresql.org> writes:

 Andrew> Support hashed aggregation with grouping sets.

Looks like some regression test plans aren't as stable as I hoped. On it.

-- 
Andrew (irc:RhodiumToad)


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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Support hashed aggregation with grouping sets.
@ 2017-03-27 04:39  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew Gierth <rhodiumtoad@postgresql.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2017-03-27 04:39 UTC (permalink / raw)
  To: Andrew Gierth <rhodiumtoad@postgresql.org>; +Cc: pgsql-committers

Andrew Gierth <rhodiumtoad@postgresql.org> writes:
> Support hashed aggregation with grouping sets.

Looks like this needs a bit more work to ensure the plans chosen
for the regression test examples are stable ...

			regards, tom lane


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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-03-27 04:39 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 03:47 pgsql: Support hashed aggregation with grouping sets. Andrew Gierth <rhodiumtoad@postgresql.org>
2017-03-27 04:37 ` Andrew Gierth <andrew@tao11.riddles.org.uk>
2017-03-27 04:39 ` Tom Lane <tgl@sss.pgh.pa.us>

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