Re: Is it useful to record whether plans are generic or custom?

Поиск
Список
Период
Сортировка
От Atsushi Torikoshi
Тема Re: Is it useful to record whether plans are generic or custom?
Дата
Msg-id CACZ0uYGfMHVvKFCU5tEbRejew8VTagLaEqUVW0t6SZ1ynMO9hw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is it useful to record whether plans are generic or custom?  (legrand legrand <legrand_legrand@hotmail.com>)
Ответы Re: Is it useful to record whether plans are generic or custom?  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: Is it useful to record whether plans are generic or custom?  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Sat, May 16, 2020 at 6:01 PM legrand legrand <legrand_legrand@hotmail.com> wrote:
> To track executed plan types, I think execution layer hooks
> are appropriate.
> These hooks, however, take QueryDesc as a param and it does
> not include cached plan information.

It seems that the same QueryDesc entry is reused when executing
a generic plan.
For exemple marking queryDesc->plannedstmt->queryId (outside
pg_stat_statements) with a pseudo tag during ExecutorStart
reappears in later executions with generic plans ...

Is this QueryDesc reusable by a custom plan ? If not maybe a solution
could be to add a flag in queryDesc->plannedstmt ?

Thanks for your proposal!

I first thought it was a good idea and tried to add a flag to QueryDesc,
but the comments on QueryDesc say it encapsulates everything that
the executor needs to execute a query.

Whether a plan is generic or custom is not what executor needs to
know for running queries, so now I hesitate to do so.

Instead, I'm now considering using a static hash for prepared queries
(static HTAB *prepared_queries).


BTW, I'd also appreciate other opinions about recording the number
of generic and custom plans on pg_stat_statemtents. 


Regards,

--
Atsushi Torikoshi

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: factorial function/phase out postfix operators?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: factorial function/phase out postfix operators?