Re: FW: Re: [PERFORM] Query is running very slow...... - Mailing list pgsql-performance

From Andreas Kretschmer
Subject Re: FW: Re: [PERFORM] Query is running very slow......
Date
Msg-id c8e8c3d7-313f-c89c-c67a-91deaa12d82b@a-kretschmer.de
Whole thread Raw
In response to Re: FW: Re: [PERFORM] Query is running very slow......  (Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>)
List pgsql-performance



Am 26.05.2017 um 14:31 schrieb Dinesh Chandra 12108:
Hi Thomas,

Thanks for your reply.

Yes, the query is absolutely same which I posted.
Please suggest if something need to change in query.

As Per your comment...
The query you posted includes there two join conditions:
    evidence_to_do.project_id = tool_performance.project_id    evidence_to_do.project_id = project.project_id

But the plan only seems to enforce the equality between 'project' and 'tool_performance'. So when joining the evidence_to_do, it performs a cartesian product, producing ~52B rows (estimated). That can't be fast.



Dinesh, please check that again. Your colleague Daulat Ram posted a similar question with this WHERE-Condition:

===

WHERE workflow.project

.project_id = workflow.tool_performance.project_id AND insert_time >'2017-05-01' AND insert_time <'2017-05-02' AND

workflow.evidence_to_do.status_id in (15100,15150,15200,15300,15400,15500) ===

This condition would explain the query-plan. I have answered that question yesterday.


Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com

pgsql-performance by date:

Previous
From: Dinesh Chandra 12108
Date:
Subject: Re: FW: Re: [PERFORM] Query is running very slow......
Next
From: "Kevin.Hughes@uk.fujitsu.com"
Date:
Subject: [PERFORM] Client Server performance & UDS