Minimize slot creation for multi-inserts of pg_shdepend

Michael Paquier <michael@paquier.xyz>

Commit: 022350b8495a8a7ff0ff8dd6791572e91e7cd6fe
Author: Michael Paquier <michael@paquier.xyz>
Date: 2020-08-01T02:49:13Z
Releases: 14.0
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

Files

PathChange+/−
src/backend/catalog/pg_shdepend.c modified +16 −6

Discussion