pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify and speed up pg_dump's creation of parent-table links.
Date: Fri, 17 Mar 2023 17:43:12 +0000
Message-ID: <E1pdE6i-0041EV-57@gemulon.postgresql.org> (raw)

Simplify and speed up pg_dump's creation of parent-table links.

Instead of trying to optimize this by skipping creation of the
links for tables we don't plan to dump, just create them all in
bulk with a single scan over the pg_inherits data.  The previous
approach was more or less O(N^2) in the number of pg_inherits
entries, not to mention being way too complicated.

Also, don't create useless TableAttachInfo objects.
It's silly to create a TableAttachInfo object that we're not
going to dump, when we know perfectly well at creation time
that it won't be dumped.

Patch by me; thanks to Julien Rouhaud for review.

Discussion: https://postgr.es/m/1376149.1675268279@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/064709f803c05559d2849a62fdb855fbb91ffeb8

Modified Files
--------------
src/bin/pg_dump/common.c  | 128 +++++++++++++++++++---------------------------
src/bin/pg_dump/pg_dump.c |   3 --
src/bin/pg_dump/pg_dump.h |   5 +-
3 files changed, 56 insertions(+), 80 deletions(-)



Message-ID: <E1pdE6i-0041EV-57@gemulon.postgresql.org>
Permalink:  ../E1pdE6i-0041EV-57@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pdE6i-0041EV-57@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Simplify and speed up pg_dump's creation of parent-table links.
  In-Reply-To: <E1pdE6i-0041EV-57@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox