Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?
Date
Msg-id 20200731024148.GB3317@paquier.xyz
Whole thread Raw
In response to Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Thu, Jul 30, 2020 at 11:23:38PM +0200, Daniel Gustafsson wrote:
> Looks good, thanks.  Let's close the CF entry with this and open a new for the
> pg_depend part when that's done.

I have applied the patch, thanks.

And actually, I have found just after that CREATE DATABASE gets
severely impacted by the number of slots initialized when copying the
template dependencies if there are few of them.  The fix is as simple
as delaying the initialization of the slots once we know they will be
used.  In my initial tests, I was using fsync = off, so I missed that.
Sorry about that.  The attached fixes this regression by delaying the
slot initialization until we know that it will be used.  This does not
matter for pg_attribute as we know in advance the number of attributes
to insert.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Cache relation sizes?
Next
From: David Rowley
Date:
Subject: Re: Index Skip Scan (new UniqueKeys)