Allow auto_explain to log plans before queries are executed

Поиск
Список
Период
Сортировка
От Yugo NAGATA
Тема Allow auto_explain to log plans before queries are executed
Дата
Msg-id 20200227023518.7331aa1470a57b450dc11c14@sraoss.co.jp
обсуждение исходный текст
Ответы Re: Allow auto_explain to log plans before queries are executed  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
Hi,

Attached is a patch for allowing auto_explain to log plans before
queries are executed.

Currently, auto_explain logs plans only after query executions,
so if a query gets stuck its plan could not be logged. If we can
know plans of stuck queries, we may get some hints to resolve the
stuck. This is useful when you are testing and debugging your
application whose queries get stuck in some situations.

This patch adds  new option log_before_query to auto_explain.
Setting auto_explain.log_before_query option logs all plans before
queries are executed regardless of auto_explain.log_min_duration
unless this is set -1 to disable logging.  If log_before_query is
enabled, only duration time is logged after query execution as in
the case of when both log_statement and log_min_duration_statement
are enabled.

Regards,
Yugo Nagata

-- 
Yugo NAGATA <nagata@sraoss.co.jp>

Вложения

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: truncating timestamps on arbitrary intervals
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Allow auto_explain to log plans before queries are executed