Re: nodeAgg perf tweak

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: nodeAgg perf tweak
Дата
Msg-id 1102031840.22124.214.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: nodeAgg perf tweak  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: nodeAgg perf tweak
Список pgsql-hackers
On Thu, 2004-12-02 at 10:45 -0500, Tom Lane wrote:
> (2) I think you lose much of the performance
> benefit as soon as you have to distinguish cases (b) and (c).  Ideally
> you would use MemoryContextContains for this, but that doesn't work
> reliably on pointers that point to fields of a tuple.

Why wouldn't a simple comparison work? We're passing two arguments into
the aggregate function: (a) corresponds to returning the first argument,
and (b) corresponds to returning the second argument. If the aggregate
wants to do something more than just return one of the arguments, they
can copy/alloc in the current context.

> I like the approach shown in my prototype patch better, because it
> doesn't create any backwards-compatibility issues for existing aggregate
> functions; instead individual aggregates may be rewritten to avoid
> palloc's.

Yeah, I like your approach as well (sorry, I had thought Simon's earlier
suggestion along these lines would have required adding knowledge about
builtin aggregates to advance_transition_function() itself; adding
knowledge to the aggregate implementation is a lot nicer).

-Neil




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

Предыдущее
От: Travis P
Дата:
Сообщение: Re: 8.0RC1 tomorrow
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: multiline CSV fields