Re: Aggregate-function space leakage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org, Chris Spotts <rfusca(at)gmail(dot)com>
Subject: Re: Aggregate-function space leakage
Date: 2009-07-23 18:32:29
Message-ID: 23043.1248373949@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-07-23 18:36:38 Re: Aggregate-function space leakage
Previous Message Robert Haas 2009-07-23 18:25:24 Re: extension facility (was: revised hstore patch)