log_duration and log_statement

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: log_duration and log_statement
Date: 2006-03-13 22:40:24
Message-ID: 1d4e0c10603131440l1993255bh9d9bb2cb026f700@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Here are some background information to explain our issue and request.
We are currently planning a migration from PostgreSQL 7.4 to
PostgreSQL 8.1. We work on a medium sized database (2GB) with a rather
important activity (12 millions queries a day with peaks up to 1000
queries/s).
We are analyzing the logs with a tool we developed (namely pgFouine
available on pgFoundry). We currently use the following configuration
for logging:
- log_min_duration_statement = 500 to log the slowest queries
- log_duration to log every query duration and have a global overview
of our database activity (used to generate this sort of graphs:
http://people.openwide.fr/~gsmet/postgresql/graphs.html ).
We cannot log every query as we already generate 1.2GB of logs a day
while only logging the text of one hundredth of the queries so we log
only the duration for the "not so slow" queries.

I didn't notice the log_duration behaviour has changed starting from
8.0 (thanks to oicu for pointing me the 8.0 release notes on
#postgresql) and what we did is not possible anymore with 8.x as
log_duration now only logs the duration for queries logged with
log_statement.

I think the former behaviour can be interesting in our case and
probably for many other people out there who use log analysis tools as
logging only slow queries is not enough to have an overview of the
database activity.
I was thinking about something like log_duration = 'none|logged|all'
which will allow us to switch between:
- none: we don't log the duration (=log_duration=off);
- logged: we log the duration only for logged queries (depending on
log_statement as for 8.0);
- all: we log every duration as 7.4 did before when log_duration was on.

Any comment on this?

Thanks in advance for considering my request.

Regards,

--
Guillaume

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2006-03-13 23:15:15 Re: DB2-style INS/UPD/DEL RETURNING
Previous Message Jonah H. Harris 2006-03-13 22:02:44 Re: DB2-style INS/UPD/DEL RETURNING