Re: [HACKERS] Memory grows without bounds in aggregates! - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Memory grows without bounds in aggregates!
Date
Msg-id 24111.922641294@sss.pgh.pa.us
Whole thread Raw
In response to Memory grows without bounds in aggregates!  (Michael Contzen <mcontzen@dohle.com>)
Responses Re: [HACKERS] Memory grows without bounds in aggregates!
List pgsql-hackers
Michael Contzen <mcontzen@dohle.com> writes:
> [ out of memory for ]
> stamm=> select sum(ekumsatz), sum(vkumsatz),sum(lvkumsatz),count(*) from
> west0;

Right, this is an instance of a known problem (palloc'd temporaries for
aggregate functions aren't freed until end of statement).  I think
someone was looking into a quick-hack patch for aggregates, but there
are comparable problems in evaluation of WHERE expressions, COPY, etc.
We really need a general-purpose solution, and that probably won't
happen till 6.6.

In the meantime, I expect that doing only one float8 sum() per select
would take a third as much memory --- you might find that that's an
adequate workaround for the short run.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Contzen
Date:
Subject: Memory grows without bounds in aggregates!
Next
From: Vadim Mikheev
Date:
Subject: vacuum updated...