David Rowley <dgrowleyml@gmail.com> writes:
> On Sat, 29 Mar 2025 at 10:30, Renan Alves Fonseca
> <renanfonseca@gmail.com> wrote:
>> Currently, in the SQL function path the plan is always generic. The
>> planner ignores the function arguments. The plan_cache_mode setting
>> has no effect in this path.
>> I agree that the docs should be more explicit about this. There is a
>> high penalty for using generic plans in complex functions.
> If you have any suggestions about where you think those should be
> added or wording for that, please feel free to suggest.
The issue's likely to be moot very shortly [1]. Maybe somebody
will be excited enough to consider changing the docs in the back
branches. But since it was like this for a couple of decades,
I bet not.
regards, tom lane
[1] https://www.postgresql.org/message-id/flat/8216639.NyiUUSuA9g%40aivenlaptop