Re: Memory Issue with array_agg?

From: Christoph Moench-Tegeder <cmt(at)burggraben(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Memory Issue with array_agg?
Date: 2013-08-19 05:45:06
Message-ID: 20130819054506.GA2329@reindeer.exwg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

## Robert Sosinski (rsosinski(at)ticketevolution(dot)com):

> When using array_agg on a large table, memory usage seems to spike up until
> Postgres crashes with the following error:

This sounds like bug #7916.
http://www.postgresql.org/message-id/E1UCeEU-0004hY-Pq@wrigleys.postgresql.org
As noted in that thread, changing the AllocSet parameters for
acummArrayResult may help (call to AllocSetContextCreate() in
ArrayBuildState *accumArrayResult(), src/backend/utils/adt/arrayfuncs.c,
change ALLOCSET_DEFAULT_*SIZE to ALLOCSET_SMALL_*SIZE).
Also, lowering work_mem may help, depending on your SQL.

Regards,
Christoph

--
Spare Space

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-08-19 07:29:47 Re: Memory Issue with array_agg?
Previous Message Basavaraj 2013-08-19 05:44:49 thank you