Re: Aggregate-function space leakage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Aggregate-function space leakage
Date
Msg-id 23043.1248373949@sss.pgh.pa.us
Whole thread Raw
In response to Re: Aggregate-function space leakage  (Hitoshi Harada <umi.tanuki@gmail.com>)
Responses Re: Aggregate-function space leakage
List pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes:
> So two ideas from Tom seem to me a little worse than that. Modifying
> Agg.c might add overhead to reset context group by group and forcing
> array_agg() (i.e. user aggregates) to distinguish hash-mode and
> group-mode is definitely heavy for users.

I agree that the second choice would be a pain.  I think you are
overestimating the cost of the first choice though.  We have already
taken steps to ensure that MemoryContextReset is *extremely* cheap
when there is nothing for it to do.  If there is something for it to
do, well, that's the case that we have a memory leak now.  Also,
resetting the context should be cheaper than retail pfree's anyway.

Anyway, I'll go take a look at exactly what would be involved in the
first choice.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: extension facility (was: revised hstore patch)
Next
From: Tom Lane
Date:
Subject: Re: Aggregate-function space leakage