pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to log quires which are taking time in PostgreSQL 9.1.
5+ messages / 3 participants
[nested] [flat]
* How to log quires which are taking time in PostgreSQL 9.1.
@ 2017-02-23 16:21 Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
2017-02-23 16:30 ` Re: How to log quires which are taking time in PostgreSQL 9.1. ProPAAS DBA <dba@propaas.com>
0 siblings, 1 reply; 5+ messages in thread
From: Dinesh Chandra 12108 @ 2017-02-23 16:21 UTC (permalink / raw)
To: pgsql-performance
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<mailto:%7Cdinesh.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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to log quires which are taking time in PostgreSQL 9.1.
2017-02-23 16:21 How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
@ 2017-02-23 16:30 ` ProPAAS DBA <dba@propaas.com>
2017-02-23 16:44 ` Re: How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
0 siblings, 1 reply; 5+ messages in thread
From: ProPAAS DBA @ 2017-02-23 16:30 UTC (permalink / raw)
To: 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
> <mailto:%7Cdinesh.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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to log quires which are taking time in PostgreSQL 9.1.
2017-02-23 16:21 How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
2017-02-23 16:30 ` Re: How to log quires which are taking time in PostgreSQL 9.1. ProPAAS DBA <dba@propaas.com>
@ 2017-02-23 16:44 ` Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
0 siblings, 0 replies; 5+ messages in thread
From: Dinesh Chandra 12108 @ 2017-02-23 16:44 UTC (permalink / raw)
To: ProPAAS DBA <dba@propaas.com>; pgsql-performance; +Cc: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Thanks for reply.
May I know where it will create log??
In pg_log directory or somewhere else.
Regards,
Dinesh Chandra
|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.
------------------------------------------------------------------
Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com<mailto:%7Cdinesh.chandra@cyient.com>
Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of ProPAAS DBA
Sent: 23 February, 2017 10:01 PM
To: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
set log_min_duration_statement = 300,000
(300,000 ms = 5min)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to log quires which are taking time in PostgreSQL 9.1.
@ 2017-02-23 16:59 Luis Fernando Simone <luis.simone@datacoper.com.br>
2017-02-23 17:21 ` Re: How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
0 siblings, 1 reply; 5+ messages in thread
From: Luis Fernando Simone @ 2017-02-23 16:59 UTC (permalink / raw)
To: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>; +Cc: ProPAAS DBA <dba@propaas.com>; pgsql-performance
The parameter "log_directory" on postgresql.conf, you can define where it'll be created.
The name of the log file is defined on "log_filename".
----- Mensagem original -----
De: "Dinesh Chandra 12108" <Dinesh.Chandra@cyient.com>
Para: "ProPAAS DBA" <dba@propaas.com>, pgsql-performance@postgresql.org
Cc: "Dinesh Chandra 12108" <Dinesh.Chandra@cyient.com>
Enviadas: Quinta-feira, 23 de Fevereiro de 2017 13:44:05
Assunto: Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
Thanks for reply.
May I know where it will create log??
In pg_log directory or somewhere else.
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.
From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of ProPAAS DBA
Sent: 23 February, 2017 10:01 PM
To: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
set log_min_duration_statement = 300,000
(300,000 ms = 5min)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How to log quires which are taking time in PostgreSQL 9.1.
2017-02-23 16:59 Re: How to log quires which are taking time in PostgreSQL 9.1. Luis Fernando Simone <luis.simone@datacoper.com.br>
@ 2017-02-23 17:21 ` Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
0 siblings, 0 replies; 5+ messages in thread
From: Dinesh Chandra 12108 @ 2017-02-23 17:21 UTC (permalink / raw)
To: Luis Fernando Simone <luis.simone@datacoper.com.br>; +Cc: ProPAAS DBA <dba@propaas.com>; pgsql-performance
Hi Luis,
Thanks for your reply.
It’s logging the quires which are taking more than specified time in log_min_duration_statement().
Thanks so much.
Regards,
Dinesh Chandra
|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.
------------------------------------------------------------------
Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com<mailto:%7Cdinesh.chandra@cyient.com>
Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
From: Luis Fernando Simone [mailto:luis.simone@datacoper.com.br]
Sent: 23 February, 2017 10:29 PM
To: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Cc: ProPAAS DBA <dba@propaas.com>; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
The parameter "log_directory" on postgresql.conf, you can define where it'll be created.
The name of the log file is defined on "log_filename".
________________________________
De: "Dinesh Chandra 12108" <Dinesh.Chandra@cyient.com<mailto:Dinesh.Chandra@cyient.com>>
Para: "ProPAAS DBA" <dba@propaas.com<mailto:dba@propaas.com>>, pgsql-performance@postgresql.org<mailto:pgsql-performance@postgresql.org>
Cc: "Dinesh Chandra 12108" <Dinesh.Chandra@cyient.com<mailto:Dinesh.Chandra@cyient.com>>
Enviadas: Quinta-feira, 23 de Fevereiro de 2017 13:44:05
Assunto: Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
Thanks for reply.
May I know where it will create log??
In pg_log directory or somewhere else.
Regards,
Dinesh Chandra
|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.
------------------------------------------------------------------
Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com<mailto:%7Cdinesh.chandra@cyient.com>
Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
From: pgsql-performance-owner@postgresql.org<mailto:pgsql-performance-owner@postgresql.org> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of ProPAAS DBA
Sent: 23 February, 2017 10:01 PM
To: pgsql-performance@postgresql.org<mailto:pgsql-performance@postgresql.org>
Subject: Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.
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<mailto:%7Cdinesh.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.
---------------------------------------------------------------
Este E-Mail foi processado por um Filtro Anti-SPAM, e recebeu
um status, caso voc� n�o concorde com o status recebido, clique
em um dos links abaixo listado.
Click here to mark email as junk<http://shaakti.datacoper.com.br:5272/FrontController?operation=mbeu&f=00001_-45_20170223_1898627...;.
---------------------------------------------------------------
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2017-02-23 17:21 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23 16:21 How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
2017-02-23 16:30 ` Re: How to log quires which are taking time in PostgreSQL 9.1. ProPAAS DBA <dba@propaas.com>
2017-02-23 16:44 ` Re: How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
2017-02-23 16:59 Re: How to log quires which are taking time in PostgreSQL 9.1. Luis Fernando Simone <luis.simone@datacoper.com.br>
2017-02-23 17:21 ` Re: How to log quires which are taking time in PostgreSQL 9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox