More pg_dump performance hacking

Started by Tom Laneover 4 years ago1 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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

Attachments:

0001-get-rid-of-owner-subqueries.patchtext/x-diff; charset=us-ascii; name=0001-get-rid-of-owner-subqueries.patchDownload+216-208
0002-simplify-identity-sequence-check.patchtext/x-diff; charset=us-ascii; name=0002-simplify-identity-sequence-check.patchDownload+1-6