Re: improve performance of pg_dump --binary-upgrade

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Corey Huinker <corey.huinker@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, pgsql-hackers@postgresql.org
Date: 2024-04-18T06:24:12Z
Lists: pgsql-hackers
On Thu, Apr 18, 2024 at 02:08:28AM -0400, Corey Huinker wrote:
> Bar-napkin math tells me in a worst-case architecture and braindead byte
> alignment, we'd burn 64 bytes per struct, so the 100K tables cited would be
> about 6.25MB of memory.
> 
> The obvious low-memory alternative would be to make a prepared statement,
> though that does nothing to cut down on the roundtrips.
> 
> I think this is a good trade off.

I've not checked the patch in details or tested it, but caching this
information to gain this speed sounds like a very good thing.
--
Michael

Commits

  1. Improve performance of binary_upgrade_set_pg_class_oids().

  2. Remove is_index parameter from binary_upgrade_set_pg_class_oids().

  3. pg_upgrade: Preserve relfilenodes and tablespace OIDs.

  4. pg_dump: minor performance improvements from eliminating sub-SELECTs.