Re: Querying one partition in a function takes locks on all partitions
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Renan Alves Fonseca <renanfonseca@gmail.com>,
Evgeny Morozov <postgresql4@realityexists.net>,
pgsql-general <pgsql-general@postgresql.org>
Date: 2025-03-31T03:21:53Z
Lists: pgsql-general
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