Re: log_duration

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: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: log_duration
Date: 2003-02-13 04:46:11
Message-ID: 200302130446.h1D4kBF29082@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > One nice thing is that each element is orthoginal. But, for the
> > functionality desired, we have to merge log_statement and log_duration
> > and have it print for statements taking over X milliseconds. I have no
> > problem adding it, but it has to be clear it isn't orthoginal but is a
> > conditional combination of two other parameters.
>
> Actually, I was wondering if we shouldn't *replace* the current
> log_duration with a combined form (that specifies a minimum interesting
> duration). I can't quite see the need for orthogonality here. The
> only reason you'd care about query duration is that you're looking for
> the slow ones, no? So why bother logging the fast ones? Besides, you
> can specify min-duration zero if you really want 'em all.

We did talk about this a while ago, and folks wanted the query printed
_before_ it was executed, so they could see the query in the logs at the
time it was issued, both for monitoring and for showing the time the
query started when log_timestamp is enabled.

Seems the clearest option would be for log_duration to print the query
string too, and convert it to an integer field. I can see zero meaning
print all queries and durations. What value do we use to turn it off?
-1?

This would give us log_statement that prints at query start, and
log_duration that prints query and duration at query end. How is that?

Maybe we should rename them as log_statement_start and
log_statement_duration.

--
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-02-13 04:47:39 Re: psql source suggestions
Previous Message Tom Lane 2003-02-13 04:38:11 Re: psql source suggestions