Re: fix log_min_duration_statement logic error

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix log_min_duration_statement logic error
Date: 2003-10-05 22:20:51
Message-ID: 200310052220.h95MKpZ11782@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Sets a minimum statement execution time (in milliseconds)
> > above which a statement will be logged. All SQL statements
> > that run longer than the time specified will be logged together
> > ! with their actual duration. Setting this to zero will print
> > ! all queries with their durations. Minus-one (the default)
> > ! disables time-based logging. For example, if you set it
> > to <literal>250</literal> then all SQL statements that run longer
> > ! than 250ms will be logged.
>
> You're being very unclear, not to say self-contradictory, as to whether
> the condition is "> value" or ">= value". I suspect it is really the
> latter but this description sure doesn't convey the fact.
>
> > Only superusers can increase this or set it to zero if this option
> > is set to non-zero by the administrator.
>
> If you're changing the "off" state to -1 then this last sentence is now
> wrong, no? Also, do the non-superuser adjustment constraints in guc.c
> still work correctly with this meaning (probably so, but it needs to be
> checked)?

OK, new text:

<varlistentry>
<term><varname>log_min_duration_statement</varname> (<type>integer</type>)</term>
<listitem>
<para>
Sets a minimum statement execution time (in milliseconds)
for statement to be logged. All SQL statements
that run in the time specified or longer will be logged with
their duration. Setting this to zero will print
all queries and their durations. Minus-one (the default)
disables this. For example, if you set it to
<literal>250</literal> then all SQL statements that run 250ms
or longer will be logged. Enabling this option can be
useful in tracking down unoptimized queries in your applications.
Only superusers can increase this or set it to minus-one if this
option is set by the administrator.
</para>
</listitem>
</varlistentry>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-10-05 22:22:14 Re: fix log_min_duration_statement logic error
Previous Message Bruce Momjian 2003-10-05 22:14:45 Re: fix log_min_duration_statement logic error