pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replace explicit PIN entries in pg_depend with an OID range test
Date: Thu, 15 Jul 2021 15:41:56 +0000
Message-ID: <E1m43Uq-0006tK-GX@gemulon.postgresql.org> (raw)

Replace explicit PIN entries in pg_depend with an OID range test.

As of v14, pg_depend contains almost 7000 "pin" entries recording
the OIDs of built-in objects.  This is a fair amount of bloat for
every database, and it adds time to pg_depend lookups as well as
initdb.  We can get rid of all of those entries in favor of an OID
range check, i.e. "OIDs below FirstUnpinnedObjectId are pinned".

(template1 and the public schema are exceptions.  Those exceptions
are now wired into IsPinnedObject() instead of initdb's code for
filling pg_depend, but it's the same amount of cruft either way.)

The contents of pg_shdepend are modified likewise.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a49d081235997c67e8aab7a523b17e8d1cb93184

Modified Files
--------------
doc/src/sgml/bki.sgml                     | 28 ++++++---
doc/src/sgml/catalogs.sgml                | 60 ++++++++-----------
src/backend/access/transam/varsup.c       | 49 ++++++++++++++--
src/backend/access/transam/xlog.c         |  2 +-
src/backend/catalog/catalog.c             | 96 +++++++++++++++++++++++++++++--
src/backend/catalog/dependency.c          | 32 ++++-------
src/backend/catalog/genbki.pl             | 10 ++--
src/backend/catalog/pg_depend.c           | 66 ++++++---------------
src/backend/catalog/pg_publication.c      |  2 +-
src/backend/catalog/pg_shdepend.c         | 92 ++++++-----------------------
src/backend/commands/tablecmds.c          | 16 ++----
src/backend/commands/tablespace.c         |  4 +-
src/backend/optimizer/plan/setrefs.c      |  6 +-
src/backend/storage/lmgr/predicate.c      |  2 +-
src/bin/initdb/initdb.c                   | 77 +------------------------
src/bin/pg_resetwal/pg_resetwal.c         |  2 +-
src/include/access/transam.h              | 16 ++++--
src/include/catalog/catalog.h             |  2 +
src/include/catalog/catversion.h          |  2 +-
src/include/catalog/dependency.h          | 18 ++----
src/include/catalog/pg_depend.h           | 11 ++--
src/include/catalog/pg_proc.dat           |  4 ++
src/include/catalog/pg_shdepend.h         | 12 ++--
src/test/regress/expected/misc_sanity.out | 57 ++----------------
src/test/regress/sql/misc_sanity.sql      | 58 ++-----------------
25 files changed, 291 insertions(+), 433 deletions(-)



Message-ID: <E1m43Uq-0006tK-GX@gemulon.postgresql.org>
Permalink:  ../E1m43Uq-0006tK-GX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m43Uq-0006tK-GX@gemulon.postgresql.org

 · 

reply

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: Replace explicit PIN entries in pg_depend with an OID range test
  In-Reply-To: <E1m43Uq-0006tK-GX@gemulon.postgresql.org>
  References: <E1m43Uq-0006tK-GX@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