pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
log_min_duration_statement
6+ messages / 4 participants
[nested] [flat]

* log_min_duration_statement
@ 2005-01-26 10:39  Eric Brown <eric.brown@propel.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Eric Brown @ 2005-01-26 10:39 UTC (permalink / raw)
  To: pgsql-general

I set this to 250 and the statements that take longer than this are 
logged... but my driver is creating all kinds of cursors, so it isn't 
logging anything useful. Yet, if I log all statement 
(log_statment='mod'), I get way more logging than is useful. Is there a 
happy medium?

This is what I'm getting now(for example):
Jan 26 02:26:15 abacagw postgres[28359]: [22-1] LOG:  duration: 284.786 
ms  statement: FETCH 1 FROM "PgSQL_A8A3BE0C"
Jan 26 02:26:15 abacagw postgres[27992]: [19-1] LOG:  duration: 254.549 
ms  statement: FETCH 1 FROM "PgSQL_A8A2884C"
Jan 26 02:26:15 abacagw postgres[28432]: [11-1] LOG:  duration: 376.167 
ms  statement: FETCH 1 FROM "PgSQL_A8A49CAC"
Jan 26 02:26:16 abacagw postgres[28359]: [23-1] LOG:  duration: 373.027 
ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
Jan 26 02:26:16 abacagw postgres[28539]: [10-1] LOG:  duration: 278.023 
ms  statement: FETCH 1 FROM "PgSQL_A8A387EC"
Jan 26 02:26:16 abacagw postgres[28361]: [24-1] LOG:  duration: 499.291 
ms  statement: FETCH 1 FROM "PgSQL_A8A68F0C"
Jan 26 02:26:17 abacagw postgres[28359]: [24-1] LOG:  duration: 636.480 
ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
Jan 26 02:26:17 abacagw postgres[28399]: [9-1] LOG:  duration: 369.708 
ms  statement: FETCH 1 FROM "PgSQL_A89CB0AC"
Jan 26 02:26:17 abacagw postgres[28432]: [12-1] LOG:  duration: 304.065 
ms  statement: FETCH 1 FROM "PgSQL_A89E1CAC"
Jan 26 02:26:17 abacagw postgres[28361]: [25-1] LOG:  duration: 252.809 
ms  statement: FETCH 1 FROM "PgSQL_A8A3694C"

Eric Brown
408-571-6341
www.propel.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: log_min_duration_statement
@ 2005-01-26 14:22  Lonni J Friedman <netllama@gmail.com>
  parent: Eric Brown <eric.brown@propel.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Lonni J Friedman @ 2005-01-26 14:22 UTC (permalink / raw)
  To: Eric Brown <eric.brown@propel.com>; +Cc: pgsql-general

Setting the number of something higher than 250ms ?


On Wed, 26 Jan 2005 02:39:21 -0800, Eric Brown <eric.brown@propel.com> wrote:
> I set this to 250 and the statements that take longer than this are
> logged... but my driver is creating all kinds of cursors, so it isn't
> logging anything useful. Yet, if I log all statement
> (log_statment='mod'), I get way more logging than is useful. Is there a
> happy medium?
> 
> This is what I'm getting now(for example):
> Jan 26 02:26:15 abacagw postgres[28359]: [22-1] LOG:  duration: 284.786
> ms  statement: FETCH 1 FROM "PgSQL_A8A3BE0C"
> Jan 26 02:26:15 abacagw postgres[27992]: [19-1] LOG:  duration: 254.549
> ms  statement: FETCH 1 FROM "PgSQL_A8A2884C"
> Jan 26 02:26:15 abacagw postgres[28432]: [11-1] LOG:  duration: 376.167
> ms  statement: FETCH 1 FROM "PgSQL_A8A49CAC"
> Jan 26 02:26:16 abacagw postgres[28359]: [23-1] LOG:  duration: 373.027
> ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
> Jan 26 02:26:16 abacagw postgres[28539]: [10-1] LOG:  duration: 278.023
> ms  statement: FETCH 1 FROM "PgSQL_A8A387EC"
> Jan 26 02:26:16 abacagw postgres[28361]: [24-1] LOG:  duration: 499.291
> ms  statement: FETCH 1 FROM "PgSQL_A8A68F0C"
> Jan 26 02:26:17 abacagw postgres[28359]: [24-1] LOG:  duration: 636.480
> ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
> Jan 26 02:26:17 abacagw postgres[28399]: [9-1] LOG:  duration: 369.708
> ms  statement: FETCH 1 FROM "PgSQL_A89CB0AC"
> Jan 26 02:26:17 abacagw postgres[28432]: [12-1] LOG:  duration: 304.065
> ms  statement: FETCH 1 FROM "PgSQL_A89E1CAC"
> Jan 26 02:26:17 abacagw postgres[28361]: [25-1] LOG:  duration: 252.809
> ms  statement: FETCH 1 FROM "PgSQL_A8A3694C"


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama@gmail.com
LlamaLand                       http://netllama.linux-sxs.org



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* log_min_duration_statement
@ 2019-01-24 14:23  bhargav kamineni <bhargavpostgres@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: bhargav kamineni @ 2019-01-24 14:23 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org; +Cc: bhargav kamineni <bhargavpostgres@gmail.com>

Hi Team,,

I have set log_min_duration_statement=1000 as my configuration but when i
observe log file i could see queries that ran below 1000ms are also getting
logged , for instance
duration: 0.089 ms
 duration: 0.175 ms
 duration: 0.139 ms
 duration: 0.451 ms
duration: 0.136 ms
 duration: 0.340 ms
 duration: 0.150 ms
duration: 0.440 ms
duration: 0.338 ms
 duration: 0.156 ms
tion: 0.396 ms
 duration: 0.221 ms
duration: 0.161 ms
 *************
these are my logsettings

              name               |                      setting
---------------------------------+---------------------------------------------------
 log_autovacuum_min_duration     | 0
 log_checkpoints                 | on
 log_connections                 | on
 log_destination                 | syslog
 log_directory                   | log
 log_disconnections              | on
 log_duration                    | off
 log_error_verbosity             | default
 log_executor_stats              | off
 log_file_mode                   | 0600
 log_filename                    | postgresql-%Y-%m-%d_%H%M%S.log
 log_hostname                    | off
 log_line_prefix                 |
appname=%a,user=%u,db=%d,pid=%p,txid=%x,vtxid=%v
 log_lock_waits                  | on
 log_min_duration_statement      | 1000
 log_min_error_statement         | error
 log_min_messages                | error
 log_parser_stats                | off
 log_planner_stats               | off
 log_replication_commands        | off
 log_rotation_age                | 1440
 log_rotation_size               | 10240
 log_statement                   | all
 log_statement_stats             | off
 log_temp_files                  | 0
 log_timezone                    | Navajo
 log_truncate_on_rotation        | off
 logging_collector               | on
 max_logical_replication_workers | 4
 syslog_facility                 | local4
 syslog_ident                    | postgres
 syslog_sequence_numbers         | on
 syslog_split_messages           | on
 wal_log_hints                   | off

Regards,
Bhargav K

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: log_min_duration_statement
@ 2019-01-24 15:23  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: bhargav kamineni <bhargavpostgres@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2019-01-24 15:23 UTC (permalink / raw)
  To: bhargav kamineni <bhargavpostgres@gmail.com>; pgsql-general@lists.postgresql.org

On 1/24/19 6:23 AM, bhargav kamineni wrote:
> Hi Team,,
> 
> I have set log_min_duration_statement=1000 as my configuration but when 
> i observe log file i could see queries that ran below 1000ms are also 
> getting logged , for instance
> duration: 0.089 ms
>   duration: 0.175 ms
>   duration: 0.139 ms
>   duration: 0.451 ms
> duration: 0.136 ms
>   duration: 0.340 ms
>   duration: 0.150 ms
> duration: 0.440 ms
> duration: 0.338 ms
>   duration: 0.156 ms
> tion: 0.396 ms
>   duration: 0.221 ms
> duration: 0.161 ms
>   *************

The above would not happen to be autovacuum statements?

You have log_autovacuum_min_duration = 0 below.

> these are my logsettings
> 
>                name               |                      setting
> ---------------------------------+---------------------------------------------------
>   log_autovacuum_min_duration     | 0
>   log_checkpoints                 | on
>   log_connections                 | on
>   log_destination                 | syslog
>   log_directory                   | log
>   log_disconnections              | on
>   log_duration                    | off
>   log_error_verbosity             | default
>   log_executor_stats              | off
>   log_file_mode                   | 0600
>   log_filename                    | postgresql-%Y-%m-%d_%H%M%S.log
>   log_hostname                    | off
>   log_line_prefix                 | 
> appname=%a,user=%u,db=%d,pid=%p,txid=%x,vtxid=%v
>   log_lock_waits                  | on
>   log_min_duration_statement      | 1000
>   log_min_error_statement         | error
>   log_min_messages                | error
>   log_parser_stats                | off
>   log_planner_stats               | off
>   log_replication_commands        | off
>   log_rotation_age                | 1440
>   log_rotation_size               | 10240
>   log_statement                   | all
>   log_statement_stats             | off
>   log_temp_files                  | 0
>   log_timezone                    | Navajo
>   log_truncate_on_rotation        | off
>   logging_collector               | on
>   max_logical_replication_workers | 4
>   syslog_facility                 | local4
>   syslog_ident                    | postgres
>   syslog_sequence_numbers         | on
>   syslog_split_messages           | on
>   wal_log_hints                   | off
> 
> Regards,
> Bhargav K
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: log_min_duration_statement
@ 2019-01-24 15:52  bhargav kamineni <bhargavpostgres@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 6+ messages in thread

From: bhargav kamineni @ 2019-01-24 15:52 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org

> Hi Team,,
>
> I have set log_min_duration_statement=1000 as my configuration but when
> i observe log file i could see queries that ran below 1000ms are also
> getting logged , for instance
> duration: 0.089 ms
>   duration: 0.175 ms
>   duration: 0.139 ms
>   duration: 0.451 ms
> duration: 0.136 ms
>   duration: 0.340 ms
>   duration: 0.150 ms
> duration: 0.440 ms
> duration: 0.338 ms
>   duration: 0.156 ms
> tion: 0.396 ms
>   duration: 0.221 ms
> duration: 0.161 ms
>   *************

>The above would not happen to be autovacuum statements?

Nope, those are not autovaccum related logs , they are related to queries
only.

You have log_autovacuum_min_duration = 0 below.

On Thu, 24 Jan 2019 at 20:53, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 1/24/19 6:23 AM, bhargav kamineni wrote:
> > Hi Team,,
> >
> > I have set log_min_duration_statement=1000 as my configuration but when
> > i observe log file i could see queries that ran below 1000ms are also
> > getting logged , for instance
> > duration: 0.089 ms
> >   duration: 0.175 ms
> >   duration: 0.139 ms
> >   duration: 0.451 ms
> > duration: 0.136 ms
> >   duration: 0.340 ms
> >   duration: 0.150 ms
> > duration: 0.440 ms
> > duration: 0.338 ms
> >   duration: 0.156 ms
> > tion: 0.396 ms
> >   duration: 0.221 ms
> > duration: 0.161 ms
> >   *************
>
> The above would not happen to be autovacuum statements?
>
> You have log_autovacuum_min_duration = 0 below.
>
> > these are my logsettings
> >
> >                name               |                      setting
> >
> ---------------------------------+---------------------------------------------------
> >   log_autovacuum_min_duration     | 0
> >   log_checkpoints                 | on
> >   log_connections                 | on
> >   log_destination                 | syslog
> >   log_directory                   | log
> >   log_disconnections              | on
> >   log_duration                    | off
> >   log_error_verbosity             | default
> >   log_executor_stats              | off
> >   log_file_mode                   | 0600
> >   log_filename                    | postgresql-%Y-%m-%d_%H%M%S.log
> >   log_hostname                    | off
> >   log_line_prefix                 |
> > appname=%a,user=%u,db=%d,pid=%p,txid=%x,vtxid=%v
> >   log_lock_waits                  | on
> >   log_min_duration_statement      | 1000
> >   log_min_error_statement         | error
> >   log_min_messages                | error
> >   log_parser_stats                | off
> >   log_planner_stats               | off
> >   log_replication_commands        | off
> >   log_rotation_age                | 1440
> >   log_rotation_size               | 10240
> >   log_statement                   | all
> >   log_statement_stats             | off
> >   log_temp_files                  | 0
> >   log_timezone                    | Navajo
> >   log_truncate_on_rotation        | off
> >   logging_collector               | on
> >   max_logical_replication_workers | 4
> >   syslog_facility                 | local4
> >   syslog_ident                    | postgres
> >   syslog_sequence_numbers         | on
> >   syslog_split_messages           | on
> >   wal_log_hints                   | off
> >
> > Regards,
> > Bhargav K
> >
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: log_min_duration_statement
@ 2019-01-24 21:13  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: bhargav kamineni <bhargavpostgres@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Adrian Klaver @ 2019-01-24 21:13 UTC (permalink / raw)
  To: bhargav kamineni <bhargavpostgres@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

On 1/24/19 7:52 AM, bhargav kamineni wrote:
>> Hi Team,,
>> 

> 
>  >The above would not happen to be autovacuum statements?
> Nope, those are not autovaccum related logs , they are related to 
> queries only.

On the chance that this setting is being overridden somewhere what does 
the below show when run as a superuser?:

select * from pg_settings where name= 'log_min_duration_statement';


More info:

https://www.postgresql.org/docs/11/view-pg-settings.html

-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2019-01-24 21:13 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-26 10:39 log_min_duration_statement Eric Brown <eric.brown@propel.com>
2005-01-26 14:22 ` Lonni J Friedman <netllama@gmail.com>
2019-01-24 14:23 log_min_duration_statement bhargav kamineni <bhargavpostgres@gmail.com>
2019-01-24 15:23 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-01-24 15:52   ` bhargav kamineni <bhargavpostgres@gmail.com>
2019-01-24 21:13     ` Adrian Klaver <adrian.klaver@aklaver.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