Re: question about executor hooks

Поиск
Список
Период
Сортировка
От Sami Imseih
Тема Re: question about executor hooks
Дата
Msg-id CAA5RZ0vUUcA4h6tVwwHLsy46Fioy-DMBr1AOHO9LGKNHNH4MjA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: question about executor hooks  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
I recommend you to review the documentation in
backend/executor/README. It explains in good detail how
the executor works. Specifically the section "Query Processing Control Flow"
explains what each of the hooks you reference are responsible for.
Also, be aware that there are operations, called utility statements,
that may not go through the executor; i.e. CREATE TABLE t (id int),
will go through ProcessUtility ( also has a hook ) only as it's a utility
statement and not a plannable statement.

As mentioned above, pg_stat_statements is a good reference extension
that implements these hooks for query level executions statistics.

> Moreover, installing an hook is cluster-wide, right? Is there a way to
> limit an hook only for connections related to a single database
> (without taking into account FDW and friends)?

It depends on the hook. pg_stat_statements for example loads the
hooks at startup time, but the extension itself implements a GUC
that allows a user to skip doing any work inside these hooks.

Regards,

Sami



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