Re: log_duration is redundant, no? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: log_duration is redundant, no?
Date
Msg-id 20060915231050.GA24914@alvh.no-ip.org
Whole thread Raw
In response to Re: log_duration is redundant, no?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: log_duration is redundant, no?  ("Guillaume Smet" <guillaume.smet@gmail.com>)
List pgsql-hackers
Tom Lane wrote:
> "Guillaume Smet" <guillaume.smet@gmail.com> writes:
> > If we consider that the prepare and the bind operations are important
> > (and I agree they can be), I wonder why do we remove the output we
> > have when log_min_duration_statement is set to 0 (I'm thinking of the
> > parse: and bind: lines)?
> 
> Well, we remove it for the execute: too if you have only log_duration
> on.  My view of this is that log_duration is meant to find out the total
> amount of time spent doing stuff, and you set log_min_duration_statement
> to whatever your threshold of pain is for the amount of time spent doing
> a single thing.  If it's less than log_min_duration_statement then
> you're saying you don't care about the details of that individual step,
> only the aggregate runtime.

It might make sense to log _what_ is going on, without telling all the
little details, for example

LOG:  parse duration: 0.250 ms
LOG:  bind duration: 0.057 ms
LOG:  execute my_query: SELECT * FROM shop WHERE $1 = $2
DETAIL:  parameters: $1 = 'Clothes Clothes Clothes', $2 = 'Joe''s Widgets'

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Reducing data type space usage
Next
From: Bruce Momjian
Date:
Subject: Re: Emacs local vars at the tail of every file