Re: Parallel Aggregates for string_agg and array_agg
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>,
Stephen Frost <sfrost@snowman.net>,
Andres Freund <andres@anarazel.de>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-03-28T03:28:19Z
Lists: pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes: > On 03/27/2018 04:51 AM, David Rowley wrote: >> Seems I didn't mean "trans types". I should have said aggregate >> function argument types. > I'm not sure that's better than the check proposed by Tom. An argument > type without send/receive function does not necessarily mean we can't > serialize/deserialize the trans value. Because who says the argument > value will be embedded in the trans value? In general we would not know that, but *for these specific serial/ deserial functions*, we know exactly what they will do. Also, IIRC, the trans type is declared as INTERNAL, so we don't really have any hope of identifying the behavior by inspecting that type declaration. Getting a solution that would work for other polymorphic serialization functions seems like a bit of a research project to me. In the meantime, I think David's right that what we need to look at is the actual input type of the aggregate, and then assume that what's to be serialized is an array of that. Conceivably an aggregate could be built that uses these serial/deserial functions and yet its input type is something else than what it constructs an array of ... but I find it a bit hard to wrap my brain around what that would be exactly. regards, tom lane
Commits
-
Fix unstable aggregate regression test
- f5d0e866404a 16.3 landed
- d6a6957d53e3 17.0 landed
-
Allow parallel aggregate on string_agg and array_agg
- 16fd03e95654 16.0 landed
-
Improve performance of ORDER BY / DISTINCT aggregates
- 1349d2790bf4 16.0 cited
-
Support ORDER BY within aggregate function calls, at long last providing a
- 34d26872ed81 9.0.0 cited
-
Fix broken markup.
- 6a6efb964092 9.0.0 cited