pgsql: Minimize slot creation for multi-inserts of pg_shdepend - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Minimize slot creation for multi-inserts of pg_shdepend
Date
Msg-id E1k1hbx-00013h-IW@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: pgsql: Improve programmer docs for simplehash and dynahash.
Next
From: Thomas Munro
Date:
Subject: pgsql: Use pg_pread() and pg_pwrite() in slru.c.