4 Commits

Author SHA1 Message Date
Fabrízio de Royes Mello
4118a72575 Remove parallel safe from partialize_agg
Previous PR #4307 mark `partialize_agg` and `finalize_agg` as parallel
safe but this change is leading to incorrect results in some cases.

Those functions are supposed work in parallel but seems is not the case
and it is not evident yet the root cause and how to properly use it in
parallel queries so we decided to revert this change and provide correct
results to users.

Fixes #4922
2023-01-13 07:31:55 -03:00
Alexander Kuzmenkov
5c0110cbbf Mark partialize_agg as parallel safe
Postgres knows whether a given aggregate is parallel-safe, and creates
parallel aggregation plans based on that. The `partialize_agg` is a
wrapper we use to perform partial aggregation on data nodes. It is a
pure function that produces serialized aggregation state as a result.
Being pure, it doesn't influence parallel safety. This means we don't
need to mark it parallel-unsafe to artificially disable the parallel
plans for partial aggregation. They will be chosen as usual based on
the parallel-safety of the underlying aggregate function.
2022-05-31 14:53:58 +05:30
davidkohn88
bfd92ab822 Use CREATE OR REPLACE AGGREGATE
From PG12 on, CREATE OR REPLACE is supported for aggregates,
therefore, since we have dropped support for PG11, we can avoid
going through the rigamarole of having our aggregates in a separate
file from the functions we define to support them. Nor do we need to
handle aggregates separately from other functions as their creation
is now idempotent.
2021-07-01 07:40:46 +02:00
Matvey Arye
672c41755f Rename files to partialize_finalize
It's better to have more concrete names than just util_aggfns.

Also add TSDLLEXPORT where appropriate for windows.
2019-04-12 12:12:17 -04:00