pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jon Nelson <jnelson+pgsql@jamponi.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: crash with latest git HEAD
Date: Sun, 20 Apr 2014 22:41:13 -0400
Message-ID: <16151.1398048073@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKuK5J1c4+b3t_X3+GAtXekBW_v_mp-M04BP8o28ttNz7zXd+Q@mail.gmail.com>
References: <CAKuK5J1c4+b3t_X3+GAtXekBW_v_mp-M04BP8o28ttNz7zXd+Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Jon Nelson <jnelson+pgsql@jamponi.net> writes:
> The following query results in a crash, ultimately due to the process
> running out of memory:
> create table blah as select md5(generate_series(1,50000000)::text) as a;

The behavior looks the same to me in either 9.3 or HEAD: it does consume a
lotta memory (about 7GB) but eventually finishes.  If it's crashing for
you, you probably need to look at your system-level configuration,
particularly the per-process memory ulimit level vs. available RAM/swap
and whether the dreaded OOM killer is enabled.

The reason it's eating so much memory is you've got a profligate SRF in
the SELECT's targetlist.  Try it as, eg,

create table blah as select md5(g::text) as a from generate_series(1,50000000) g;

While it's be nice to not have SRFs in the targetlist be a memory problem,
it's not an easy thing to do, and I doubt anyone is going to look very
hard for a fix for what is basically a deprecated feature.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <16151.1398048073@sss.pgh.pa.us>
Permalink:  ../16151.1398048073@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16151.1398048073@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jnelson+pgsql@jamponi.net
  Subject: Re: crash with latest git HEAD
  In-Reply-To: <16151.1398048073@sss.pgh.pa.us>
  References: <CAKuK5J1c4+b3t_X3+GAtXekBW_v_mp-M04BP8o28ttNz7zXd+Q@mail.gmail.com> <16151.1398048073@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox