Re: On-demand running query plans using auto_explain and signals

Поиск
Список
Период
Сортировка
От Shulgin, Oleksandr
Тема Re: On-demand running query plans using auto_explain and signals
Дата
Msg-id CACACo5R6G=iUEE3zcCK43RagmwXxy7PAhHU_9nW3ZvC2_jsDfg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: On-demand running query plans using auto_explain and signals  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Список pgsql-hackers
On Fri, Sep 25, 2015 at 7:13 PM, Shulgin, Oleksandr <oleksandr.shulgin@zalando.de> wrote:

Some implementation details:

For every backend that might be running (MaxBackends) we reserve a dsm_handle slot in the addins shared memory.  When the new option is turned on, the ExecutorRun hook will produce a plan in whatever format is specified by the auto_explain.log_format, allocate a DSM segment, copy the plan into the segment and finally store the DSM handle into its own slot.  No locking is required around this because every backend writes to its slot exclusively, no other backend can be writing into it concurrently.  In the ExecutorFinish hook we invalidate the backend's slot by setting the handle to 0 and deallocate the DSM segment.

And this patch adds back the use of table of contents on the DSM.  Benefits: magic number validation; communication of the actual plan size.

--
Alex

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Doubt in pgbench TPS number
Следующее
От: Marti Raudsepp
Дата:
Сообщение: Re: BRIN indexes for MAX, MIN, ORDER BY?