From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid parsing catalog data twice during BKI file construction.
Date: Thu, 26 Apr 2018 17:22:36 +0000
Message-ID: <E1fBkbM-0008T5-P8@gemulon.postgresql.org> (raw)
Avoid parsing catalog data twice during BKI file construction.
In the wake of commit 5602265f7, we were doing duplicate-OID detection
quite inefficiently, by invoking duplicate_oids which does all the same
parsing of catalog headers and .dat files as genbki.pl does. That adds
under half a second on modern machines, but quite a bit more on slow
buildfarm critters, so it seems worth avoiding. Let's just extend
genbki.pl a little so it can also detect duplicate OIDs, and remove
the duplicate_oids call from the build process.
(This also means that duplicate OID detection will happen during
Windows builds, which AFAICS it didn't before.)
This makes the use-case for duplicate_oids a bit dubious, but it's
possible that people will still want to run that check without doing
a whole build run, so let's keep that script.
In passing, move down genbki.pl's creation of its temp output files
so that it doesn't happen until after we've done parsing and validation
of the input. This avoids leaving a lot of clutter around after a
failure.
John Naylor and Tom Lane
Discussion: https://postgr.es/m/37D774E4-FE1F-437E-B3D2-593F314B7505@postgrespro.ru
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a0854f10722b20a445f5e67a357bd8809b32f540
Modified Files
--------------
doc/src/sgml/bki.sgml | 4 +--
src/backend/catalog/Catalog.pm | 2 ++
src/backend/catalog/Makefile | 3 +-
src/backend/catalog/genbki.pl | 71 ++++++++++++++++++++++++++++++++----------
4 files changed, 60 insertions(+), 20 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Avoid parsing catalog data twice during BKI file construction.
In-Reply-To: <E1fBkbM-0008T5-P8@gemulon.postgresql.org>
References: <E1fBkbM-0008T5-P8@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox