Re: Memory Issue with array_agg? - Mailing list pgsql-general

From Christoph Moench-Tegeder
Subject Re: Memory Issue with array_agg?
Date
Msg-id 20130819054506.GA2329@reindeer.exwg.net
Whole thread Raw
In response to Memory Issue with array_agg?  (Robert Sosinski <rsosinski@ticketevolution.com>)
List pgsql-general
## Robert Sosinski (rsosinski@ticketevolution.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


pgsql-general by date:

Previous
From: Jayadevan M
Date:
Subject: Re: PostgreSQL 9.3
Next
From: Pavel Stehule
Date:
Subject: Re: Memory Issue with array_agg?