More pg_dump performance hacking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: More pg_dump performance hacking
Date: 2021-12-30 22:28:38
Message-ID: 2460369.1640903318@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Attached are a couple of patches for loose ends that I didn't
get to when I was working on pg_dump before the last CF.

0001 removes all the "username_subquery" subqueries in favor
of doing local username lookups. On the regression database
with no extra roles, it seems to be more or less a wash ...
but if I create 100 roles, then the patch seems to save five
or ten percent compared to HEAD.

I also got rid of the rather-pointless-IMO checks for pg_authid
join failures, in favor of having the lookup subroutine just
fatal() if it doesn't find a match. I don't think we need to
burden translators with all those strings for cases that shouldn't
happen. Note that a lot of object types weren't checking
for this condition anyway, making it even more pointless.

0002 is a very small patch that gets rid of an extra subquery
for identity-sequence checking, realizing that the LEFT JOIN
in the FROM clause will have picked up that row already,
if it exists. This again saves a few percent for
"pg_dump -s regression", though the effects would depend a lot
on how many sequences you have.

These don't seem complicated enough to require real review,
so I plan to just push them, unless there are objections.

regards, tom lane

Attachment Content-Type Size
0001-get-rid-of-owner-subqueries.patch text/x-diff 47.0 KB
0002-simplify-identity-sequence-check.patch text/x-diff 756 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-12-30 23:32:29 Re: Column Filtering in Logical Replication
Previous Message Justin Pryzby 2021-12-30 22:16:34 Re: Column Filtering in Logical Replication