Minimize slot creation for multi-inserts of pg_shdepend
authorMichael Paquier <michael@paquier.xyz>
Sat, 1 Aug 2020 02:49:13 +0000 (11:49 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 1 Aug 2020 02:49:13 +0000 (11:49 +0900)
commit022350b8495a8a7ff0ff8dd6791572e91e7cd6fe
treea868fe45c4092ee3920ba6a0d75e2bd17265e396
parent84c0e4b9bce794da914fe9c062753bf21369745f
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
src/backend/catalog/pg_shdepend.c