Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?
Date: 2020-07-31 02:41:48
Message-ID: 20200731024148.GB3317@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pgshdepend-insert-fix.patch text/x-diff 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-07-31 03:06:44 Re: Index Skip Scan (new UniqueKeys)
Previous Message Thomas Munro 2020-07-31 02:36:12 Re: Cache relation sizes?