Re: SQLFunctionCache and generic plans
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Alexander Korotkov <aekorotkov@gmail.com>, pgsql-hackers@lists.postgresql.org, Ronan Dunklau <ronan.dunklau@aiven.io>
Date: 2025-02-26T19:34:42Z
Lists: pgsql-hackers
hI I can confirm 60% speedup for execution of function fx and fx3 - both functions are very primitive, so for real code the benefit can be higher Unfortunately, there is about 5% slowdown for inlined code, and for just plpgsql code too. I tested fx4 create or replace function fx4(int) returns int immutable as $$ begin return $1 + $1; end $$ language plpgsql; and fx2 create or replace function fx2(int) returns int as $$ select 2 * $1; $$ language sql immutable; and execution of patched code is about 5% slower. It is strange so this patch has a negative impact on plpgsql execution. Regards Pavel
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