diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-07-03 15:42:10 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-07-03 15:42:10 -0400 |
commit | 1f902d499eda862a98e881a2227b8d2cf3565374 (patch) | |
tree | 6c480382bdb509f2c1057353ecc185278a63b241 /src/backend/access/gist/gistscan.c | |
parent | ecd9e9f0bc141550726b2205dd6f5745a58e9ecd (diff) | |
download | postgresql-1f902d499eda862a98e881a2227b8d2cf3565374.tar.gz postgresql-1f902d499eda862a98e881a2227b8d2cf3565374.zip |
Inline plpgsql's exec_stmt() into exec_stmts().
This saves one level of C function call per plpgsql statement executed,
and permits a tiny additional optimization of not saving and restoring
estate->err_stmt for each statement in a block. The net effect seems
nearly un-measurable on x86_64, but there's a clear win on aarch64,
amounting to two or three percent in a loop over a few simple plpgsql
statements.
To do this, we have to get rid of the other existing call sites for
exec_stmt(). Replace them with exec_toplevel_block(), which is just
defined to do what exec_stmts() does, but for a single
PLpgSQL_stmt_block statement. Hard-wiring the expectation of which
statement type applies here allows us to skip the dispatch switch,
making this not much uglier than the previous factorization.
Amit Khandekar, tweaked a bit by me
Discussion: https://postgr.es/m/CAJ3gD9eBNrmUD7WBBLG8ohaZ485H9y+4eihQTgr+K8Lhka3vcQ@mail.gmail.com
Diffstat (limited to 'src/backend/access/gist/gistscan.c')
0 files changed, 0 insertions, 0 deletions