pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedMemory exhausted in AllocSetAlloc
3+ messages / 3 participants
[nested] [flat]
* Memory exhausted in AllocSetAlloc
@ 2001-06-06 16:24 george young <gry@ll.mit.edu>
0 siblings, 2 replies; 3+ messages in thread
From: george young @ 2001-06-06 16:24 UTC (permalink / raw)
To: pgsql-sql
[Postgresql 7.0.3, intel Linux, 4 cpu, 2 GB RAM ]
create table stepparams(step_proc text, name text, txt text, units text, step_ver int2, width int2,
xpos int2, param_edit int2, xlevel int2, mandatory int2, primary key(step_proc));
The table stepparams has 15799 rows, 387 distinct values of step_proc.
For each value stepparams.step_proc e.g. 'foo', there should be a postgres table named "s_foo".
I want to check this for consistancy, i.e. find any stepparams.step_proc that does not have a corresponding table.
I thought this was a straight forward query:
select distinct step_proc
from stepparams sp
where not exists (select * from pg_class where text(relname)= 's_' || sp.step_proc);
but, after a while I get an error: FATAL 1: Memory exhausted in AllocSetAlloc()
pqReadData() -- backend closed the channel unexpectedly.
[indeed the backend had grown to 400MB, 173MB resident!]
So, I tried another formulation:
select distinct sp.step_proc
from stepparams sp
where substring(sp.step_proc from 2) not in (select sp.step_proc from pg_class);
but the same error results.
I tried:
select distinct step_proc
from stepparams sp
where not exists (select * from pg_class where text(relname)= 's_' || sp.step_proc);
but again the same error.
What am I doing wrong?
Here appended are the explain for these queries:
explain select distinct sp.step_proc from stepparams sp where substring(sp.step_proc from 2) not in (select sp.step_proc from pg_class);
NOTICE: QUERY PLAN:
Unique (cost=0.00..198558.04 rows=1580 width=12)
-> Index Scan using stepparams_idx on stepparams sp (cost=0.00..198518.54 rows=15799 width=12)
SubPlan
-> Seq Scan on pg_class (cost=0.00..24.96 rows=896 width=4)
explain select distinct step_proc from stepparams sp where sp.step_proc not in (select 's_' || sp.step_proc from pg_class);
NOTICE: QUERY PLAN:
Unique (cost=0.00..198518.54 rows=1580 width=12)
-> Index Scan using stepparams_idx on stepparams sp (cost=0.00..198479.04 rows=15799 width=12)
SubPlan
-> Seq Scan on pg_class (cost=0.00..24.96 rows=896 width=4)
explain select distinct step_proc from stepparams sp where not exists (select * from pg_class where text(relname)= 's_' || sp.step_proc);
NOTICE: QUERY PLAN:
Unique (cost=56244.75..56244.75 rows=0 width=12)
-> Sort (cost=56244.75..56244.75 rows=1 width=12)
-> Seq Scan on stepparams sp (cost=0.00..56244.74 rows=1 width=12)
SubPlan
-> Seq Scan on pg_class (cost=0.00..31.68 rows=9 width=85)
--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now? [OK]
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Memory exhausted in AllocSetAlloc
@ 2001-06-06 17:29 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: george young <gry@ll.mit.edu>
1 sibling, 0 replies; 3+ messages in thread
From: Stephan Szabo @ 2001-06-06 17:29 UTC (permalink / raw)
To: george young <gry@ll.mit.edu>; +Cc: pgsql-sql
You probably should upgrade to 7.1.2. I think alot of
memory leaking conditions were fixed between 7.0 and 7.1.
On Wed, 6 Jun 2001, george young wrote:
> [Postgresql 7.0.3, intel Linux, 4 cpu, 2 GB RAM ]
>
> create table stepparams(step_proc text, name text, txt text, units text, step_ver int2, width int2,
> xpos int2, param_edit int2, xlevel int2, mandatory int2, primary key(step_proc));
>
> The table stepparams has 15799 rows, 387 distinct values of step_proc.
>
> For each value stepparams.step_proc e.g. 'foo', there should be a postgres table named "s_foo".
> I want to check this for consistancy, i.e. find any stepparams.step_proc that does not have a corresponding table.
>
> I thought this was a straight forward query:
> select distinct step_proc
> from stepparams sp
> where not exists (select * from pg_class where text(relname)= 's_' || sp.step_proc);
> but, after a while I get an error: FATAL 1: Memory exhausted in AllocSetAlloc()
> pqReadData() -- backend closed the channel unexpectedly.
> [indeed the backend had grown to 400MB, 173MB resident!]
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Memory exhausted in AllocSetAlloc
@ 2001-06-06 17:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: george young <gry@ll.mit.edu>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2001-06-06 17:49 UTC (permalink / raw)
To: george young <gry@ll.mit.edu>; +Cc: pgsql-sql
george young <gry@ll.mit.edu> writes:
> What am I doing wrong?
Using 7.0.3 ;-)
Update to 7.1.*. It doesn't leak memory during queries (or at least,
not as badly as prior releases).
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-06-06 17:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-06 16:24 Memory exhausted in AllocSetAlloc george young <gry@ll.mit.edu>
2001-06-06 17:29 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-06-06 17:49 ` Tom Lane <tgl@sss.pgh.pa.us>
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