Skip site navigation (1) Skip section navigation (2)

Re: Patch proposal for log_duration

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch proposal for log_duration
Date: 2006-03-30 16:31:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
"Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com> writes:
> As explained in the previous thread, we used to play with log_duration
> and log_min_error_statement to have the following behaviour:
> - log every duration so that we can have a global overview of the
> database activity;
> - log statement only for slowest queries.

I really find it pretty bizarre to want to log a duration without
logging the statement that caused it.  Seems like the
log_min_duration_statement parameter ought to be enough.  These logging
options are already messy and unintuitive, and adding still more odd
frammishes doesn't help that ...

Changing code without changing the associated comments isn't a good way
to get your ideas accepted, either, eg here:
          /* Only print duration if we previously printed the statement. */
!         if ((log_statement == LOGSTMT_ALL && save_log_duration == LOGDRTN_LOGGED) || save_log_duration == LOGDRTN_ALL)

The patch makes that comment a lie.  This is not acceptable coding practice.

			regards, tom lane

In response to


pgsql-patches by date

Next:From: Kevin GrittnerDate: 2006-03-30 23:50:02
Subject: Re: Additional current timestamp values
Previous:From: Guillaume SmetDate: 2006-03-30 14:22:12
Subject: Patch proposal for log_duration

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group