Re: ToDo: log plans of cancelled queries

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: ToDo: log plans of cancelled queries
Дата
Msg-id CA+U5nMJvqFLJvADPJ7dnL_VgiT2eDivs6BjxLADHGqMbwg3AzQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ToDo: log plans of cancelled queries  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 11 January 2013 16:52, Simon Riggs <simon@2ndquadrant.com> wrote:

> We already overload the signals, so its just a new type for the signal
> handler to cope with.
>
> See procsignal_sigusr1_handler()

I roughed up something to help you here... this is like 50% of a patch.

pg_explain_backend() calls a SIGUSR1 variant which then allows a call
to RunDynamicExplain() during any call to CHECK_FOR_INTERRUPTS()

That only works when something in the executor has called
SetDynamicExplain(), which later needs to be Unset...

So that's all you need to invoke a dynamic EXPLAIN via a sysadmin
function. All you need to do is generate an EXPLAIN and dump it
somewhere useful, like the server log. Over to you Pavel. There's a
patch somewhere by Greg Stark that generated a plan from a running
server for progress bar stuff, but that was like 5 years ago nearly.
But the explain invocation stuff from that might be useful as a guide.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)