ERROR: out of memory DETAIL: Failed on request of size ???

From: Brian Wong <bwong64(at)hotmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: ERROR: out of memory DETAIL: Failed on request of size ???
Date: 2013-11-18 20:40:11
Message-ID: BLU171-W750930D4BCF4ADA59455FFBEE40@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We'd like to seek out your expertise on postgresql regarding this error that we're getting in an analytical database.

Some specs:
proc: Intel Xeon X5650 @ 2.67Ghz dual procs 6-core, hyperthreading on.
memory: 48GB
OS: Oracle Enterprise Linux 6.3postgresql version: 9.1.9

shared_buffers: 18GB

We're doing a grouping query like this:

create table test as
select col1, max(col2), max(col3), max(col4), max(col5)
from view
where ...
and ...
and ...
group by col1;

The
view queries another view that does a lot of UNION ALLs of tables.
This particular case I'm dealing with about 60 tables unioned together.

The resulting error is:
ERROR: out of memory
DETAIL: Failed on request of size ???

The
issue seems a straight match with this link I found online:
http://stackoverflow.com/questions/11878035/postgresql-9-1-out-of-memory-during-create-table-as-select

After
doing a lot of googling, I've tried setting FETCH_COUNT on psql AND/OR
setting work_mem. I'm just not able to work around this issue, unless
if I take most of the MAX() functions out but just one.

Would anyone give me some hints on how to resolve this issue?

Brian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Keller 2013-11-19 01:39:17 Re: Postgres as In-Memory Database?
Previous Message Kevin Grittner 2013-11-18 19:51:45 Re: Regex files are missing