forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd5e8930
committed
pg_dump: minor performance improvements from eliminating sub-SELECTs.
Get rid of the "username_subquery" mechanism in favor of doinglocal lookups of role names from role OIDs. The PG backend isn'tterribly smart about scalar SubLinks in SELECT output lists,so this offers a small performance improvement, at least ininstallations with more than a couple of users. In any casethe old method didn't make for particularly readable SQL code.While at it, I removed the various custom warning messages aboutfailing to find an object's owner, in favor of just fatal'ingin the local lookup function. AFAIK there is no reason anylonger to treat that as anything but a catalog-corruption case,and certainly no reason to make translators deal with a dozendifferent messages where one would do. (If it turns out thatfatal() is indeed a bad idea, we can back off to issuingpg_log_warning() and returning an empty string, resulting inthe same behavior as before, except more consistent.)Also drop an entirely unnecessary sub-SELECT to check on thepg_depend status of a sequence relation: we already have aLEFT JOIN to fetch the row of interest in the FROM clause.Discussion:https://postgr.es/m/2460369.1640903318@sss.pgh.pa.us1 parent93d9734 commitd5e8930