Re: Query out of memory
От | Guillaume Lelarge |
---|---|
Тема | Re: Query out of memory |
Дата | |
Msg-id | CAECtzeUGEBNxpqazBjGkoLGqBMowjTbqdmAan+2ZLOfFtvT01A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Query out of memory (aditya desai <admad123@gmail.com>) |
Список | pgsql-sql |
Le lun. 18 oct. 2021 à 21:03, aditya desai <admad123@gmail.com> a écrit :
Not many active connections. Only 30-40.
This means you can consume up to 60-80 GB. Way much more than the available RAM. You should lower your work_mem value.
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 tohttps://pgtune.leopard.in.ua/ to start with.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 fromgk_staging g, transaction t,account awhereg.accountcodeis not null ANDg.accountcode::text <> '' ANDlength(g.accountcode)=13 ANDg.closeid::text=t.transactionid::text ANDsubsrting(g.accountcode::text,8)=a.mask_code::textBelow are system parameters.shared_buffers=3GBwork_mem=2GBeffective_cache_size=10GBmaintenance_work_mem=1GBmax_connections=250I am unable to paste explain plan here due to security concerns.Regards,Aditya.
В списке pgsql-sql по дате отправления: