Re: SQLFunctionCache and generic plans
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Cc: Pavel Stehule <pavel.stehule@gmail.com>,
Alexander Korotkov <aekorotkov@gmail.com>,
pgsql-hackers@lists.postgresql.org,
Ronan Dunklau <ronan.dunklau@aiven.io>
Date: 2025-03-29T14:08:49Z
Lists: pgsql-hackers
Alexander Pyhalov <a.pyhalov@postgrespro.ru> writes: > After writing some comments, looking at it once again, I've found that > one assumption is wrong - function can be discarded from cache during > its execution. Yeah. You really need a use-count on the shared cache object. I've been working on pulling out plpgsql's code that manages its function cache into a new module that can be shared with functions.c. That code is quite battle-tested and I don't see a good argument for reinventing the logic. It's not fit to share yet, but I hope to have something in a day or so. > Also one interesting note is as we don't use raw_parse_tree, it seems we > don't need plansource->parserSetup and plansource->parserSetupArg. It > seems we can avoid caching complete parse info. Well, you do need those when dealing with an old-style function (raw parse trees). regards, tom lane
Commits
-
Fix performance issue in deadlock-parallel isolation test.
- 837cc73af29c 18.0 landed
-
functions.c: copy trees from source_list before parse analysis etc.
- 0f43083d16f4 18.0 landed
-
Fix oversight in commit 0dca5d68d.
- dbd437e670b8 18.0 landed
-
Change SQL-language functions to use the plan cache.
- 0dca5d68d7be 18.0 landed
-
Reordering DISTINCT keys to match input path's pathkeys
- a8ccf4e93a7e 18.0 cited