Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>, Nitin Motiani <nitinmotiani@google.com>, Hannu Krosing <hannuk@google.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-05T19:31:23Z
Lists: pgsql-hackers
On Thu, Feb 05, 2026 at 01:02:17PM -0500, Andres Freund wrote: > Upthread I also wondering why we do all the work in getLOs() if we don't > actually need most of it (only if there are comments or labels). Right now > that's a very slow and very memory intensive part of doing an upgrade of a > system with a lot of binary upgrades. Do we need *any* of that if we go the > path you suggest? AFAICT we only need it for the comments and security labels later on. Commit a45c78e3 did batch 1000 large objects into each ArchiveEntry, but of course there can still be a ton of entries. In theory, we could update the pg_largeobject_metadata query to only retrieve LOs with comments and security labels. I'm not sure it's worth trying to optimize further than that; we've long operated under the assumption that comments/seclabels on LOs are pretty rare. -- nathan
Commits
-
pg_upgrade: Use COPY for LO metadata for upgrades from < v12.
- b33f75361284 19 (unreleased) landed
-
pg_upgrade: Fix handling of pg_largeobject_metadata.
- 158408fef8b9 19 (unreleased) landed
-
pg_upgrade: Transfer pg_largeobject_metadata's files when possible.
- 3bcfcd815e1a 19 (unreleased) landed
-
Rearrange pg_dump's handling of large objects for better efficiency.
- a45c78e3284b 17.0 cited
-
Expand AclMode to 64 bits
- 7b378237aa80 16.0 cited
-
Fix pg_upgrade for oid removal.
- 12a53c732ced 12.0 cited