pgsql: Minimize slot creation for multi-inserts of pg_shdepend

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Minimize slot creation for multi-inserts of pg_shdepend
Date: 2020-08-01 02:51:01
Message-ID: E1k1hbx-00013h-IW@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Minimize slot creation for multi-inserts of pg_shdepend

When doing multiple insertions in pg_shdepend for the copy of
dependencies from a template database in CREATE DATABASE, the same
number of slots would have been created and used all the time. As the
number of items to insert is not known in advance, this makes most of
the slots created for nothing. This improves the slot handling so as
slot creation only happens when needed, minimizing the overhead of the
operation.

Author: Michael Paquier
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20200731024148.GB3317@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/022350b8495a8a7ff0ff8dd6791572e91e7cd6fe

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2020-08-01 12:24:03 pgsql: Use pg_pread() and pg_pwrite() in slru.c.
Previous Message Thomas Munro 2020-08-01 00:16:26 pgsql: Improve programmer docs for simplehash and dynahash.