Re: nodeAgg perf tweak - Mailing list pgsql-hackers

From Neil Conway
Subject Re: nodeAgg perf tweak
Date
Msg-id 1102038280.22124.232.camel@localhost.localdomain
Whole thread Raw
In response to Re: nodeAgg perf tweak  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: nodeAgg perf tweak
List pgsql-hackers
On Thu, 2004-12-02 at 19:07 -0500, Tom Lane wrote:
> True, but you still have to palloc if it returns the second argument.

Is that common? In any case, I don't see how you can _ever_ avoid a
palloc if the aggregate returns the second argument. The second argument
is in a per-tuple memory context: there's nothing the aggregate, or
nodeAgg, can do about it.

I think the tradeoffs between our patches are:

- mine would apply to all aggregates, without the need to modify any of
them individually
- yours would mean that int8inc() and similar aggregates wouldn't ever
need to do palloc(); mine would require a palloc() every k calls to the
transition function. I don't really see this as a problem: in practice k
will be sufficiently large that the palloc overhead should be
negligible.

-Neil




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Unicode characters above 0x10000 #2
Next
From: Tom Lane
Date:
Subject: Re: nodeAgg perf tweak