Thread: crash with latest git HEAD

crash with latest git HEAD

From
Jon Nelson
Date:
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;

I'm running 602b27ab8e45fbb07cf5b275b0593b38190232e4.

I haven't yet done any git bisecting.

--
Jon

Re: crash with latest git HEAD

From
Tom Lane
Date:
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