Re: [HACKERS] Aggregate transition state merging vs. hypothetical set functions

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [HACKERS] Aggregate transition state merging vs. hypothetical set functions
Дата
Msg-id CAKJS1f_Ubu8sZfyK=vpi6va79Q4ycqVhHDokSpw5ouDZ4hbYFw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Aggregate transition state merging vs. hypothetical set functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Aggregate transition state merging vs. hypothetical set functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 13 October 2017 at 12:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> David Rowley <david.rowley@2ndquadrant.com> writes:
>> If the user defines their normal aggregate as not safe for merging,
>> then surely it'll not be suitable to be used as a window function
>> either, since the final function will also be called there multiple
>> times per state.
>
> Yeah, we would probably also want to check the flag in nodeWindowAgg.
> Not sure exactly how that should play out --- maybe we end up with
> a tri-valued property "works as normal agg without merging, works
> as normal agg with merging, works as window agg".  But this would
> arguably be an improvement over the current situation.  Right now
> I'm sure there are user-written aggs out there that will just crash
> if used as a window agg, and the authors don't have much choice because
> the performance costs of not modifying the transition state in the
> finalfn are higher than they're willing to bear.  At least with a
> flag they could ensure that the case will fail cleanly.

hmm, maybe I'm lacking imagination here, but surely the final function
is either destructive or it's not? I can't understand what the
difference between nodeAgg.c calling the finalfn multiple times on the
same state and nodeWindowAgg.c doing it. Maybe there's something I'm
not accounting for that you are?

-- David Rowley                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] oversight in EphemeralNamedRelation support
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: [HACKERS] Pluggable storage