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 |