Re: track generic and custom plans in pg_stat_statements

Поиск
Список
Период
Сортировка
От Sami Imseih
Тема Re: track generic and custom plans in pg_stat_statements
Дата
Msg-id CAA5RZ0uT1DqOw5X0r0fB68qpYRqNdREv9A8izqQu6k1LMwkByg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: track generic and custom plans in pg_stat_statements  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
Ответы Re: track generic and custom plans in pg_stat_statements
Список pgsql-hackers
> Thank you for your patch. It is really useful for tracking the history
> of generic and custom plan usage.

Thanks for the review!

> 1. Is there any reason for the double check of cplan != NULL? It seems
> unnecessary, and we could simplify it to:
>
> -if (cplan && cplan->status == PLAN_CACHE_STATUS_CUSTOM_PLAN)
> +if (cplan->status == PLAN_CACHE_STATUS_CUSTOM_PLAN)

No, it's not necessary and an oversight. removed.

> 2. Should we add Assert(kind == PGSS_EXEC) at this place  to ensure that
> generic_plan_calls and custom_plan_calls are only incremented when
> appropriate?
>

I don't think an assert is needed here. There is an assert at the start of
the block for PGSS_EXEC and PGSS_PLAN, but cplan is only available
in the executor.

v4 attached

--
Sami

Вложения

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