Re: Query out of memory - Mailing list pgsql-sql

From aditya desai
Subject Re: Query out of memory
Date
Msg-id CAN0SRDExG80fC8sEHMT9aw7kJEUVPCBjtLQ7jsyA_SB9XQ7EPw@mail.gmail.com
Whole thread Raw
In response to Re: Query out of memory  (Vijaykumar Jain <vijaykumarjain.github@gmail.com>)
Responses Re: Query out of memory
List pgsql-sql
Not many active connections. Only 30-40.

On Monday, October 18, 2021, Vijaykumar Jain <vijaykumarjain.github@gmail.com> wrote:
Work memory 2 GB ?
Is this intentional?
How many max active connections do you see?

if you have too many connections. You can try toning it down to 


On Mon, Oct 18, 2021, 10:13 PM aditya desai <admad123@gmail.com> wrote:
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-sql by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: Query out of memory
Next
From: Guillaume Lelarge
Date:
Subject: Re: Query out of memory