Re: Combining Aggregates

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Combining Aggregates
Дата
Msg-id CA+TgmobryNiZ4x7RsMt_hfw302ShaW05vByr6kZD4xQkoedOoA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Combining Aggregates  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Combining Aggregates  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Feb 24, 2015 at 2:20 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On 2/20/15 3:09 PM, Tomas Vondra wrote:
>> The 'combine' function gets two such 'state' values, while transition
>> gets 'state' + next value.
>
> I think the combine function is not actually a property of the
> aggregate, but a property of the transition function.  If two aggregates
> have the same transition function, they will also have the same combine
> function.  The combine function really just says, how do you combine two
> series of these function calls.  Say maybe this should be put into
> pg_proc instead.  (Or you make the transition functions transition
> operators and put the info into pg_operator instead, which is where
> function call optimization information is usually kept.)

This seems like a weird design to me.  It's probably true that if the
transition function is the same, the state-combiner function will also
be the same.  But the state-combiner function is only going to exist
for aggregate transition functions, not functions or operators in
general.  So linking it from pg_proc or pg_operator feels wrong to me.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)