Re: Passing "direct" args of ordered-set aggs to the transition function

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: Passing "direct" args of ordered-set aggs to the transition function
Дата
Msg-id 68FB3094-3178-4DF9-B50C-47CC18B5125D@phlo.org
обсуждение исходный текст
Ответ на Re: Passing "direct" args of ordered-set aggs to the transition function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Jan23, 2014, at 17:20 , Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Florian Pflug <fgp@phlo.org> writes:
>> Is there a particular reason why the "direct" arguments of ordered-set
>> aggregates are not passed to the transition function too?
> 
> Because they have to be evaluated only once.
> 
> I did consider evaluating them once at the start and saving the values,
> but that's a bit problematic from a memory management standpoint.

Yeah, that's what I had in mind. I not sure I understand that memory
management problems you mention though - couldn't we just copy them to
some appropriate memory context, say aggcontext?

What I'm more concerned about is whether it'd still be possible to have
ordered_set_transition and ordered_set_transition_multi work for all the
ordered-set aggregates we currently have. But I have yet to wrap my head
fully around the VARIADIC any ANY stuff that goes on there...

> Still, if you have a good solution to that and the cycles to produce a
> patch, it's not too late to reconsider.  I concur that it's not that
> hard to think of cases where it'd be useful.

I'll see what I can do.

best regards,
Florian Pflug




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Add %z support to elog/ereport?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Add %z support to elog/ereport?