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_enum
Date: Wed, 16 Nov 2022 03:43:09 +0000
Message-ID: <E1ov9KP-000Olt-3I@gemulon.postgresql.org> (raw)

Use multi-inserts for pg_enum

This allows to insert at once all the enum values defined with a given
type into pg_enum, reducing the WAL produced by roughly 10%~.  pg_enum's
indexes are opened and closed now once rather than N times.  The number
of items to insert is known in advance, making this change
straight-forward, and would happen on a CREATE TYPE .. AS ENUM.

The amount of data inserted is capped at 64kB for each insert batch.
This is similar to commits 63110c6 and e3931d01, that worked on
different catalogs.

Reported-by: Ranier Vilela
Author: Michael Paquier
Reviewed-by: Kyotaro Horiguchi, Ranier Vilela
Discussion: https://postgr.es/m/Y3M5bovrkTQbAO4W@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1ff416121884884a167f0974cea9f86a1d6a577f

Modified Files
--------------
src/backend/catalog/pg_enum.c | 55 +++++++++++++++++++++++++++++++++----------
1 file changed, 42 insertions(+), 13 deletions(-)



Message-ID: <E1ov9KP-000Olt-3I@gemulon.postgresql.org>
Permalink:  ../E1ov9KP-000Olt-3I@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ov9KP-000Olt-3I@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_enum
  In-Reply-To: <E1ov9KP-000Olt-3I@gemulon.postgresql.org>
  References: <E1ov9KP-000Olt-3I@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