Re: log_duration is redundant, no?

Поиск
Список
Период
Сортировка
От Guillaume Smet
Тема Re: log_duration is redundant, no?
Дата
Msg-id 1d4e0c10609071459o16503360xacef49bb859c8e03@mail.gmail.com
обсуждение исходный текст
Ответ на log_duration is redundant, no?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: log_duration is redundant, no?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom,

On 9/7/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> AFAICS, there is absolutely no difference anymore between turning
> log_duration ON and setting log_min_duration_statement to zero.
> ISTM that having the two redundant GUC settings is just confusing,
> and we should remove log_duration to simplify things.

log_duration can be useful if we restore a behaviour similar to what
it did in 7.4 ie when you can log duration only for every query. This
way you can have a global overview of your database activity.
I mean:
log_duration = on
log_min_duration_statement = 500
would log only duration for queries faster than 500 ms and duration +
query text for queries slower than 500ms (we can easily avoid
redundancy).

This allows you to have all query statistics without too much I/O. It
doesn't give you all the information as you don't have the query text
but it can give you useful statistics (to explain why the database
server is suddenly slower - we executed 2 millions queries last month
- now we execute 8 millions queries. We cannot easily have this sort
of information as a log_min_duration_statement = 500 won't give it and
a log_min_duration_statement = 0 generates far too I/O).

For another real life example, we are switching from a manual vacuum
to autovacuum for one of our customers and we want to know the
consequences. The query text is useless for a first analysis (and will
slow down the database too much) as we just want to detect if it's
slower or not.

Could we consider reintroduce the old behaviour rather than removing
this setting (we can rename it to a better name if needed)? I already
have a patch for that as we run a patched version of 8.1.4 here to
have this very behaviour.

--
Guillaume


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: log_duration is redundant, no?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: log_duration is redundant, no?