[COMMITTERS] pgsql: Move bootstrap-time lookup of regproc OIDs into genbki.pl.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Move bootstrap-time lookup of regproc OIDs into genbki.pl.
Дата
Msg-id E1cyhI7-0001MW-EL@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Move bootstrap-time lookup of regproc OIDs into genbki.pl.

Formerly, the bootstrap backend looked up the OIDs corresponding to
names in regproc catalog entries using brute-force searches of pg_proc.
It was somewhat remarkable that that worked at all, since it was used
while populating other pretty-fundamental catalogs like pg_operator.
And it was also quite slow, and getting slower as pg_proc gets bigger.

This patch moves the lookup work into genbki.pl, so that the values in
postgres.bki for regproc columns are always numeric OIDs, an option
that regprocin() already supported.  Perl isn't the world's speediest
language, so this about doubles the time needed to run genbki.pl (from
0.3 to 0.6 sec on my machine).  But we only do that at most once per
build.  The time needed to run initdb drops significantly --- on my
machine, initdb --no-sync goes from 1.8 to 1.3 seconds.  So this is
a small net win even for just one initdb per build, and it becomes
quite a nice win for test sequences requiring many initdb runs.

Strip out the now-dead code for brute-force catalog searching in
regprocin.  We'd also cargo-culted similar logic into regoperin
and some (not all) of the other reg*in functions.  That is all
dead code too since we currently have no need to load such values
during bootstrap.  I removed it all, reasoning that if we ever
need such functionality it'd be much better to do it in a similar
way to this patch.

There might be some simplifications possible in the backend now that
regprocin doesn't require doing catalog reads so early in bootstrap.
I've not looked into that, though.

Andreas Karlsson, with some small adjustments by me

Discussion: https://postgr.es/m/30896.1492006367@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5e39f06cfe65acbecedf42a660f577c3fca47bcc

Modified Files
--------------
src/backend/catalog/Catalog.pm   |  35 ++++--
src/backend/catalog/genbki.pl    |  50 +++++++--
src/backend/utils/Gen_fmgrtab.pl |  26 ++---
src/backend/utils/adt/regproc.c  | 228 ++++++++-------------------------------
4 files changed, 120 insertions(+), 219 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: [COMMITTERS] pgsql: pg_dump: Dump subscriptions by default
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: [COMMITTERS] pgsql: Refactor libpq authentication request processing.