pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Implement partition-wise grouping/aggregation.
2+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2018-03-26 0976c4ddd4  Make new regression  indpendent of max_parallel_workers_per_gather.
* pgsql: Implement partition-wise grouping/aggregation.
@ 2018-03-22 16:58  Robert Haas <rhaas@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Robert Haas @ 2018-03-22 16:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Implement partition-wise grouping/aggregation.

If the partition keys of input relation are part of the GROUP BY
clause, all the rows belonging to a given group come from a single
partition.  This allows aggregation/grouping over a partitioned
relation to be broken down * into aggregation/grouping on each
partition.  This should be no worse, and often better, than the normal
approach.

If the GROUP BY clause does not contain all the partition keys, we can
still perform partial aggregation for each partition and then finalize
aggregation after appending the partial results.  This is less certain
to be a win, but it's still useful.

Jeevan Chalke, Ashutosh Bapat, Robert Haas.  The larger patch series
of which this patch is a part was also reviewed and tested by Antonin
Houska, Rajkumar Raghuwanshi, David Rowley, Dilip Kumar, Konstantin
Knizhnik, Pascal Legrand, and Rafia Sabih.

Discussion: http://postgr.es/m/CAM2+6=V64_xhstVHie0Rz=KPEQnLJMZt_e314P0jaT_oJ9MR8A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e2f1eb0ee30d144628ab523432320f174a2c8966

Modified Files
--------------
doc/src/sgml/config.sgml                          |   20 +
src/backend/optimizer/README                      |   14 +
src/backend/optimizer/path/allpaths.c             |   17 +-
src/backend/optimizer/path/costsize.c             |    1 +
src/backend/optimizer/plan/createplan.c           |   10 +-
src/backend/optimizer/plan/planner.c              |  873 ++++++++++---
src/backend/utils/misc/guc.c                      |    9 +
src/backend/utils/misc/postgresql.conf.sample     |    1 +
src/include/nodes/relation.h                      |   75 +-
src/include/optimizer/cost.h                      |    1 +
src/include/optimizer/paths.h                     |    2 +
src/test/regress/expected/partition_aggregate.out | 1393 +++++++++++++++++++++
src/test/regress/expected/sysviews.out            |   37 +-
src/test/regress/parallel_schedule                |    2 +-
src/test/regress/serial_schedule                  |    1 +
src/test/regress/sql/partition_aggregate.sql      |  292 +++++
src/tools/pgindent/typedefs.list                  |    2 +
17 files changed, 2544 insertions(+), 206 deletions(-)



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

* Re: pgsql: Implement partition-wise grouping/aggregation.
@ 2018-03-22 21:07  Andres Freund <andres@anarazel.de>
  parent: Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2018-03-22 21:07 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Hi,

On 2018-03-22 16:58:01 +0000, Robert Haas wrote:
> Implement partition-wise grouping/aggregation.

> src/test/regress/expected/partition_aggregate.out | 1393 +++++++++++++++++++++
> src/test/regress/sql/partition_aggregate.sql      |  292 +++++

The new tests break installcheck for me locally. I often, during
development, have max_parallel_workers_per_gather=0 set. Previously that
was not a problem, because select_parallel.sql explicitly set
max_parallel_workers_per_gather=0. The new tests do not...

Greetings,

Andres Freund




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


end of thread, other threads:[~2018-03-22 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 16:58 pgsql: Implement partition-wise grouping/aggregation. Robert Haas <rhaas@postgresql.org>
2018-03-22 21:07 ` Andres Freund <andres@anarazel.de>

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