Re: Never Ending query in PostgreSQL - Mailing list pgsql-performance

From Mladen Gogala
Subject Re: Never Ending query in PostgreSQL
Date
Msg-id 242bb192-e280-42bb-b6a2-30e6d5466472@gmail.com
Whole thread Raw
In response to Never Ending query in PostgreSQL  ("Kumar, Mukesh" <MKumar@peabodyenergy.com>)
List pgsql-performance
On 2/26/22 23:40, Kumar, Mukesh wrote:
P {margin-top:0;margin-bottom:0;}
Hi Team, 

Can you please help in tunning the attached query as , i am trying to run this query and it runs for several hours and it did not give any output.

I am not able to generate the explain analyze plan as well and it keeps on running for several hours and did not give output.

I have attached the query and explain plan without analyze. Please help if nayone has any idea how to tune that query.

Regards, 
Mukesh Kumar 


Hi Team Member,

Your attachments are not SQL, they are plans. Judging by the size of the plans, your best course of action is to completely rewrite the queries, probably using CTE and temporary tables. May the Force be with you.

Regards

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

pgsql-performance by date:

Previous
From: Charles Huang
Date:
Subject: RLS not using index scan but seq scan when condition gets a bit complicated
Next
From: Mladen Gogala
Date:
Subject: Re: Never Ending query in PostgreSQL