Allow parallel aggregate on string_agg and array_agg
David Rowley <drowley@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +3 −3 |
| src/backend/optimizer/prep/prepagg.c | modified | +24 −4 |
| src/backend/parser/parse_agg.c | modified | +36 −1 |
| src/backend/utils/adt/arrayfuncs.c | modified | +19 −1 |
| src/backend/utils/adt/array_userfuncs.c | modified | +624 −0 |
| src/backend/utils/adt/varlena.c | modified | +191 −16 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_aggregate.dat | modified | +11 −2 |
| src/include/catalog/pg_proc.dat | modified | +27 −0 |
| src/include/parser/parse_agg.h | modified | +2 −0 |
| src/include/utils/array.h | modified | +3 −0 |
| src/test/regress/expected/aggregates.out | modified | +98 −0 |
| src/test/regress/sql/aggregates.sql | modified | +62 −0 |
Documentation touched
Discussion
- Parallel Aggregates for string_agg and array_agg 77 messages · 2017-12-17 → 2024-03-27