This patch is a followup of a discussion on -hackers about the new
behaviour of log_duration in 8.x (
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
- log statement only for slowest queries.
This setting is not yet possible with 8.x as log_duration only logs
duration for queries logged with log_statement. On our production
server, we cannot set log_statement to 'all' as it generates far too
many writes on disks when logging the text of all the queries
executed. But it's really useful for us to have a global overview of
the database activity, not only slowest queries.
FYI, our log file is used to generate this sort of report:
This patch introduces back the ability to log every duration while
keeping the new 8.x behaviour.
You can set:
- log_duration to 'none' = old off value
- log_duration to 'logged' = on value for 8.x: log duration only if
the query is logged by log_statement
- log_duration to 'all' = on value for 7.4: we log duration for every
Patch is against current CVS head and make check is OK. I tested it
with CVS and I backported it to 8.1.3 too to test it on one of our
test server using 8.1.
Please let me know if this patch needs any change as it's my first
attempt to patch PostgreSQL.
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2006-03-30 16:31:17|
|Subject: Re: Patch proposal for log_duration |
|Previous:||From: Philip Yarra||Date: 2006-03-30 03:32:39|
|Subject: Re: Show tablespace for databases with psql's \l+|