From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use multi-inserts for pg_depend
Date: Sat, 05 Sep 2020 04:56:04 +0000
Message-ID: <E1kEQFA-0005pM-Gq@gemulon.postgresql.org> (raw)
Use multi-inserts for pg_depend
This is a follow-up of the work done in e3931d01. This case is a bit
different than pg_attribute and pg_shdepend: the maximum number of items
to insert is known in advance, but there is no need to handle pinned
dependencies. Hence, the base allocation for slots is done based on the
number of items and the maximum allowed with a cap at 64kB. Slots are
initialized once used to minimize the overhead of the operation.
The insertions can be done for dependencies of the same type. More
could be done by grouping the insertion of multiple dependency types in
a single batch. This is left as future work.
Some of the multi-insert logic is also simplified for pg_shdepend, as
per the feedback discussed for this specific patch. This also moves to
indexing.h the variable capping the maximum amount of data that can be
used at once for a multi-insert, instead of having separate definitions
for pg_attribute, pg_depend and pg_shdepend.
Author: Daniel Gustafsson, Michael Paquier
Reviewed-by: Andres Freund, Álvaro Herrera
Discussion: https://postgr.es/m/20200807061619.GA23955@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/63110c6264a5363863209c8fbdd0498c03535507
Modified Files
--------------
src/backend/catalog/heap.c | 8 +---
src/backend/catalog/pg_depend.c | 90 ++++++++++++++++++++++++++++-----------
src/backend/catalog/pg_shdepend.c | 66 ++++++++++++++--------------
src/include/catalog/indexing.h | 6 +++
4 files changed, 105 insertions(+), 65 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: michael@paquier.xyz
Subject: Re: pgsql: Use multi-inserts for pg_depend
In-Reply-To: <E1kEQFA-0005pM-Gq@gemulon.postgresql.org>
References: <E1kEQFA-0005pM-Gq@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