Re: right way of using case-expressions in plpgsql functions

Поиск
Список
Период
Сортировка
От Victor Dobrovolsky
Тема Re: right way of using case-expressions in plpgsql functions
Дата
Msg-id CAJFsatNMKPztXwmdwOdkdzrAsUvU78bakE4cwS7D2n92bE6U3A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: right way of using case-expressions in plpgsql functions  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
Thank you. I'll take it.

пн, 16 окт. 2023 г. в 00:20, Ron <ronljohnsonjr@gmail.com>:
On 10/15/23 11:19, Victor Dobrovolsky wrote:
[snip]
The documentation states that after some executions of such functions the plan should become generic.
What is a generic plan for such a case and how would it work?

It's highly dependent on the query

When I see this happen (after we notice that a procedure starts taking a long time), the query planner flips from a custom plan to a generic plan after about the fifth execution in a session of a function/procedure.

This will make it calculate the plan every time:
set plan_cache_mode = force_custom_plan;

--
Born in Arizona, moved to Babylonia.

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

Предыдущее
От: Victor Dobrovolsky
Дата:
Сообщение: Re: right way of using case-expressions in plpgsql functions
Следующее
От: Thiemo Kellner
Дата:
Сообщение: Purely declarative FKs