Re: log_duration - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: log_duration
Date
Msg-id 200303141927.h2EJRco09590@candle.pha.pa.us
Whole thread Raw
In response to Re: log_duration  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Added to TODO:
* Add GUC log_statement_duration to print statement and >= min duration

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

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 

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


pgsql-hackers by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: SQL99 ARRAY support proposal
Next
From: Tom Lane
Date:
Subject: Re: Upgrading the backend's error-message infrastructure