Thread: A couple questions about ordered-set aggregates

A couple questions about ordered-set aggregates

From
Chapman Flack
Date:
I find I am allowed to create an ordered-set aggregate with a non-empty
direct argument list and no finisher function. Am I right in thinking
that's kind of nonsensical, as nothing will ever look at the direct args?

Also, the syntax summary shows PARALLEL = { SAFE | RESTRICTED | UNSAFE }
in the ordered-set syntax variant, since 9.6, though that variant
accepts no combine/serial/deserial functions, and there's also
a note saying "Partial (including parallel) aggregation is currently
not supported for ordered-set aggregates."

Does PARALLEL = { SAFE | RESTRICTED | UNSAFE } on an ordered-set
aggregate affect anything?

Regards,
-Chap



Re: A couple questions about ordered-set aggregates

From
Tomas Vondra
Date:
On Sun, Oct 25, 2020 at 09:32:22PM -0400, Chapman Flack wrote:
>I find I am allowed to create an ordered-set aggregate with a non-empty
>direct argument list and no finisher function. Am I right in thinking
>that's kind of nonsensical, as nothing will ever look at the direct args?
>
>Also, the syntax summary shows PARALLEL = { SAFE | RESTRICTED | UNSAFE }
>in the ordered-set syntax variant, since 9.6, though that variant
>accepts no combine/serial/deserial functions, and there's also
>a note saying "Partial (including parallel) aggregation is currently
>not supported for ordered-set aggregates."
>
>Does PARALLEL = { SAFE | RESTRICTED | UNSAFE } on an ordered-set
>aggregate affect anything?
>

I may be missing something, but I believe PARALLEL = SAFE simply means
it can be executed in the parallel part of the plan. That does not
require support for partial aggregation - we simply don't support
passing partial results to the leader, hence combine/serial/deserial
functions are not needed.

Not sure about the direct arguments.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services