From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow parallel aggregate on string_agg and array_agg
Date: Mon, 23 Jan 2023 04:35:40 +0000
Message-ID: <E1pJoYV-0050rd-SN@gemulon.postgresql.org> (raw)
Allow parallel aggregate on string_agg and array_agg
This adds combine, serial and deserial functions for the array_agg() and
string_agg() aggregate functions, thus allowing these aggregates to
partake in partial aggregations. This allows both parallel aggregation to
take place when these aggregates are present and also allows additional
partition-wise aggregation plan shapes to include plans that require
additional aggregation once the partially aggregated results from the
partitions have been combined.
Author: David Rowley
Reviewed-by: Andres Freund, Tomas Vondra, Stephen Frost, Tom Lane
Discussion: https://postgr.es/m/CAKJS1f9sx_6GTcvd6TMuZnNtCh0VhBzhX6FZqw17TgVFH-ga_A@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/16fd03e956540d1b47b743f6a84f37c54ac93dd4
Modified Files
--------------
doc/src/sgml/func.sgml | 6 +-
src/backend/optimizer/prep/prepagg.c | 28 +-
src/backend/parser/parse_agg.c | 37 +-
src/backend/utils/adt/array_userfuncs.c | 624 +++++++++++++++++++++++++++++++
src/backend/utils/adt/arrayfuncs.c | 20 +-
src/backend/utils/adt/varlena.c | 207 +++++++++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_aggregate.dat | 13 +-
src/include/catalog/pg_proc.dat | 27 ++
src/include/parser/parse_agg.h | 2 +
src/include/utils/array.h | 3 +
src/test/regress/expected/aggregates.out | 98 +++++
src/test/regress/sql/aggregates.sql | 62 +++
13 files changed, 1101 insertions(+), 28 deletions(-)
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: drowley@postgresql.org
Subject: Re: pgsql: Allow parallel aggregate on string_agg and array_agg
In-Reply-To: <E1pJoYV-0050rd-SN@gemulon.postgresql.org>
References: <E1pJoYV-0050rd-SN@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