Re: Using ProcSignal to get memory context stats from a running backend

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Using ProcSignal to get memory context stats from a running backend
Дата
Msg-id CAMsr+YFRK5PbaQwxCj7M60MZuZBVp0Fvng6xcbKZf1ORb=B-xw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Using ProcSignal to get memory context stats from a runningbackend  (Maksim Milyutin <milyutinma@gmail.com>)
Ответы Re: Using ProcSignal to get memory context stats from a runningbackend  (Maksim Milyutin <milyutinma@gmail.com>)
Список pgsql-hackers
On 22 December 2017 at 23:19, Maksim Milyutin <milyutinma@gmail.com> wrote:

On 22.12.2017 16:56, Craig Ringer wrote:

On 22 December 2017 at 20:50, Maksim Milyutin <milyutinma@gmail.com> wrote:

On 19.12.2017 16:54, Pavel Stehule wrote:

sorry for small offtopic. Can be used this mechanism for log of executed plan or full query?

That's a really good idea. I'd love to be able to pg_explain_backend(...)

I left the mechanism as a generic diagnostic signal exactly so that we could add other things we wanted to be able to ask backends. I think a follow-on patch that adds support for dumping explain-format plans would be great, if it's practical to do that while a query's already running.

Noticing the interest in the calling some routines on the remote backend through signals, in parallel thread[1] I have proposed the possibility to define user defined signal handlers in extensions. There is a patch taken from pg_query_state module.

1. https://www.postgresql.org/message-id/3f905f10-cf7a-d4e0-64a1-7fd9b8351592%40gmail.com


Haven't read the patch, but the idea seems useful if a bit hairy in practice. It'd be done on a "use at your own risk, and if it breaks you get to keep the pieces" basis, where no guarantees are made by Pg about how and when the function is called so it must be utterly defensive. The challenge there being that you can't always learn enough about the state of the system without doing things that might break it, so lots of things you could do would be fragile.

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

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: AS OF queries
Следующее
От: Feike Steenbergen
Дата:
Сообщение: Re: Add hint about replication slots when nearing wraparound