Query is running very slow......

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.chandra@xxxxxxxxxx

Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.

 


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux