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: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?
Date: 2019-08-05 07:45:59
Message-ID: 20190805074559.GI1740@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 05, 2019 at 09:20:07AM +0200, Daniel Gustafsson wrote:
> Thanks, the attached v4 updates to patch to handle a0555ddab9b672a046 as well.

+ if (referenced->numrefs == 1)
+ recordDependencyOn(depender, &referenced->refs[0], behavior);
+ else
+ recordMultipleDependencies(depender,
+ referenced->refs, referenced->numrefs,
+ behavior);
This makes me wonder if we should not just add a shortcut in
recordMultipleDependencies() to use recordDependencyOn if there is
only one reference in the set. That would save the effort of a multi
insert for all callers of recordMultipleDependencies() this way,
including the future ones. And that could also be done independently
of the addition of InsertPgAttributeTuples(), no?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2019-08-05 08:35:11 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Previous Message Michael Paquier 2019-08-05 07:30:52 Re: More issues with pg_verify_checksums and checksum verification in base backups