Query is running very slow......

From: Dinesh Chandra 12108 <Dinesh(dot)Chandra(at)cyient(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Cc: Dinesh Chandra 12108 <Dinesh(dot)Chandra(at)cyient(dot)com>
Subject: Query is running very slow......
Date: 2017-05-24 17:04:04
Message-ID: 3152be5a435f45649cef6bf9321beb9a@cyient.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dear Expert,

While executing the blow query, its taking too long time to fetch output.
Could you please help to fine tune the same?

SELECT
date_trunc('day', insert_time),
workflow.project.project_name,
workflow.tool_performance.project_id,
workflow.tool_performance.user_id,
workflow.tool_performance.step_id,
count(*),
round(sum(execution_time)/1000) as Sum_time_sec,
round(((round(sum(execution_time)/1000))/60)/count(*),2) as Efficency_Min,
round (((round(sum(execution_time)/1000)))/count(*),2) as Efficency_sec
FROM workflow.project,workflow.tool_performance,workflow.evidence_to_do
WHERE
workflow.evidence_to_do.project_id = workflow.tool_performance.project_id AND
workflow.evidence_to_do.project_id = workflow.project.project_id AND
workflow.tool_performance.insert_time >'2017-05-19' AND
workflow.tool_performance.insert_time <'2017-05-20' AND
workflow.evidence_to_do.status_id in (15100,15150,15200,15300,15400,15500)
Group BY
date_trunc('day', insert_time),
workflow.project.project_name,
workflow.tool_performance.project_id,
workflow.tool_performance.user_id,
workflow.tool_performance.step_id
ORDER BY
workflow.tool_performance.project_id,
workflow.project.project_name,
workflow.tool_performance.step_id

I am using PostgreSQL 9.1 with Linux Platform.

Regards,
Dinesh Chandra
|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.
------------------------------------------------------------------
Mobile: +91-9953975849 | Ext 1078 |dinesh(dot)chandra(at)cyient(dot)com<mailto:%7Cdinesh(dot)chandra(at)cyient(dot)com>
Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2017-05-24 17:25:54 Re: Query is running very slow......
Previous Message Gunnar "Nick" Bluth 2017-05-24 06:41:37 Re: select subquery versus join subquery