pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use multi-inserts for pg_attribute and pg_shdepend
Date: Fri, 31 Jul 2020 01:55:11 +0000
Message-ID: <E1k1KGN-00089W-Rm@gemulon.postgresql.org> (raw)

Use multi-inserts for pg_attribute and pg_shdepend

For pg_attribute, this allows to insert at once a full set of attributes
for a relation (roughly 15% of WAL reduction in extreme cases).  For
pg_shdepend, this reduces the work done when creating new shared
dependencies from a database template.  The number of slots used for the
insertion is capped at 64kB of data inserted for both, depending on the
number of items to insert and the length of the rows involved.

More can be done for other catalogs, like pg_depend.  This part requires
a different approach as the number of slots to use depends also on the
number of entries discarded as pinned dependencies.  This is also
related to the rework or dependency handling for ALTER TABLE and CREATE
TABLE, mainly.

Author: Daniel Gustafsson
Reviewed-by: Andres Freund, Michael Paquier
Discussion: https://postgr.es/m/20190213182737.mxn6hkdxwrzgxk35@alap3.anarazel.de

Branch
------
master

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

Modified Files
--------------
src/backend/access/heap/heapam.c  |   8 +-
src/backend/catalog/heap.c        | 199 +++++++++++++++++++++++---------------
src/backend/catalog/index.c       |  19 +---
src/backend/catalog/indexing.c    |  36 +++++++
src/backend/catalog/pg_shdepend.c |  60 +++++++++---
src/backend/commands/tablecmds.c  |   8 +-
src/include/catalog/heap.h        |   9 +-
src/include/catalog/indexing.h    |   5 +
8 files changed, 225 insertions(+), 119 deletions(-)



Message-ID: <E1k1KGN-00089W-Rm@gemulon.postgresql.org>
Permalink:  ../E1k1KGN-00089W-Rm@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1k1KGN-00089W-Rm@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: michael@paquier.xyz
  Subject: Re: pgsql: Use multi-inserts for pg_attribute and pg_shdepend
  In-Reply-To: <E1k1KGN-00089W-Rm@gemulon.postgresql.org>
  References: <E1k1KGN-00089W-Rm@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