aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/array.h
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-01-23 17:35:01 +1300
committerDavid Rowley <drowley@postgresql.org>2023-01-23 17:35:01 +1300
commit16fd03e956540d1b47b743f6a84f37c54ac93dd4 (patch)
tree5d4e04184fcc5e119b92d48529b60bc160f99633 /src/include/utils/array.h
parent5a3a95385bd5a8f1a4fd50545b7efe9338581899 (diff)
downloadpostgresql-16fd03e956540d1b47b743f6a84f37c54ac93dd4.tar.gz
postgresql-16fd03e956540d1b47b743f6a84f37c54ac93dd4.zip
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
Diffstat (limited to 'src/include/utils/array.h')
-rw-r--r--src/include/utils/array.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index 1ad074055ae..b13dfb345ef 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -409,6 +409,9 @@ extern bool array_contains_nulls(ArrayType *array);
extern ArrayBuildState *initArrayResult(Oid element_type,
MemoryContext rcontext, bool subcontext);
+extern ArrayBuildState *initArrayResultWithSize(Oid element_type,
+ MemoryContext rcontext,
+ bool subcontext, int initsize);
extern ArrayBuildState *accumArrayResult(ArrayBuildState *astate,
Datum dvalue, bool disnull,
Oid element_type,