Re: [PERFORM] How to log quires which are taking time in PostgreSQL9.1. - Mailing list pgsql-performance

From ProPAAS DBA
Subject Re: [PERFORM] How to log quires which are taking time in PostgreSQL9.1.
Date
Msg-id 691c4080-ab82-599c-0da4-8e1549349572@propaas.com
Whole thread Raw
In response to [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.  (Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>)
Responses Re: [PERFORM] How to log quires which are taking time in PostgreSQL9.1.
List pgsql-performance

set log_min_duration_statement = 300,000

(300,000 ms = 5min)


From the docs:


log_min_duration_statement (integer)

Causes the duration of each completed statement to be logged if the statement ran for at least the specified number of milliseconds. Setting this to zero prints all statement durations. Minus-one (the default) disables logging statement durations. For example, if you set it to 250ms then all SQL statements that run 250ms or longer will be logged. Enabling this parameter can be helpful in tracking down unoptimized queries in your applications. Only superusers can change this setting.





On 02/23/2017 09:21 AM, Dinesh Chandra 12108 wrote:

Dear expert,

 

I want to log only that queries which are taking around 5 minutes to execute.

I have a database size >1.5T and using PostgreSQL 9.1 with Linux OS.

 

 

Thanks in advance.

 

Regards,

Dinesh Chandra

|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.

------------------------------------------------------------------

Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com

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

 




DISCLAIMER:

This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Check all attachments for viruses before opening them. All views or opinions presented in this e-mail are those of the author and may not reflect the opinion of Cyient or those of our affiliates.

pgsql-performance by date:

Previous
From: Dinesh Chandra 12108
Date:
Subject: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
Next
From: Dinesh Chandra 12108
Date:
Subject: Re: [PERFORM] How to log quires which are taking time in PostgreSQL9.1.