Re: plan cache overhead on plpgsql expression
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-16T16:00:35Z
Lists: pgsql-hackers
ne 16. 2. 2020 v 15:12 odesílatel Pavel Stehule <pavel.stehule@gmail.com> napsal: > Hi > > when I do some profiling of plpgsql, usually I surprised how significant > overhead has expression execution. Any calculations are very slow. > > This is not typical example of plpgsql, but it shows cleanly where is a > overhead > > CREATE OR REPLACE FUNCTION public.foo() > RETURNS void > LANGUAGE plpgsql > IMMUTABLE > AS $function$ > declare i bigint = 0; > begin > while i < 100000000 > loop > i := i + 1; > end loop; > end; > $function$ > > > Is interesting so overhead of plan cache about 15% > > The execution needs 32 sec on Postgres13 and 27sec on Postgres8.2 > On same computer same example in Perl needs only 7 sec. Regards Pavel > Regards > > Pavel > >
Commits
-
Rearrange validity checks for plpgsql "simple" expressions.
- fbc7a716084e 13.0 landed
-
Improve performance of "simple expressions" in PL/pgSQL.
- 8f59f6b9c037 13.0 landed
-
Ensure that plpgsql cleans up cleanly during parallel-worker exit.
- 4bfacc5a4411 9.5.22 landed
- deeda011b316 11.8 landed
- dd51b5696aa5 9.6.18 landed
- a54a87320782 12.3 landed
- 86e5badd22d9 13.0 landed
- 42d3649b58f4 10.13 landed