Fwd: Query out of memory - Mailing list pgsql-performance

From aditya desai
Subject Fwd: Query out of memory
Date
Msg-id CAN0SRDFqJRjuSxNUrTvCQwKuhGv8r5rUn9WnX65kGSsTSxhoCw@mail.gmail.com
Whole thread Raw
Responses Re: Query out of memory
Re: Fwd: Query out of memory
Sv: Fwd: Query out of memory
List pgsql-performance
Sending to a performance group instead of PLPGSQL.

.
.
Hi,
I am running the below query. Table has 21 million records. I get an Out Of Memory error after a while.(from both pgadmin and psql). Can someone review DB parameters given below.

select t.*,g.column,a.column from
gk_staging g, transaction t,account a
where
g.accountcodeis not null AND
g.accountcode::text <> '' AND
length(g.accountcode)=13 AND
g.closeid::text=t.transactionid::text AND
subsrting(g.accountcode::text,8)=a.mask_code::text

Below are system parameters.
shared_buffers=3GB
work_mem=2GB
effective_cache_size=10GB
maintenance_work_mem=1GB
max_connections=250

I am unable to paste explain plan here due to security concerns.

Regards,
Aditya.

pgsql-performance by date:

Previous
From: Mikhail Zhilin
Date:
Subject: Re: Lock contention high
Next
From: Adam Brusselback
Date:
Subject: Re: Query out of memory