Re: pg_dump versus hash partitioning
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, pgsql-hackers@lists.postgresql.org, Andrew <pgsqlhackers@andrewrepp.com>
Date: 2023-02-01T21:12:31Z
Lists: pgsql-hackers
On Wed, Feb 1, 2023 at 12:34 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Also, and I think pretty > > significantly, using --load-via-partition-root forces you to pay the > > overhead of rerouting every tuple to the target partition whether you > > need it or not, which is potentially a large unnecessary expense. > > Oddly, I always thought that we prioritize correctness over speed. > I don't mind having an option that allows people to select a less-safe > way of doing this, but I do think it's unwise for less-safe to be the > default, especially when it's something you can't fix after the fact. +1 As you pointed out already, pg_dump's primary use-cases all involve target systems that aren't identical to the source system. Anybody using pg_dump is unlikely to be particularly concerned about performance. > What do you think of "--load-via-partition-root=on/off/auto", where > auto means "not with hash partitions" or the like? I'm still > uncomfortable about the collation aspect, but I'm willing to concede > that range partitioning is less likely to fail in this way than hash. Currently, pg_dump ignores collation versions entirely, except when run by pg_upgrade. So pg_dump already understands that sometimes it's important that the collation behavior be completely identical when the database is restored, and sometimes it's desirable to produce a dump with any available "logically equivalent" collation. This is about the high level requirements, which makes sense to me. ISTM that range partitioning is missing a good high level model that builds on that. What's really needed is a fully worked out abstraction that recognizes how collations can be equivalent for some purposes, but not other purposes. The indirection between "logical and physical collations" is underdeveloped. There isn't even an official name for that idea. -- Peter Geoghegan
Commits
-
Simplify and speed up pg_dump's creation of parent-table links.
- 064709f803c0 16.0 landed
-
Fix pg_dump for hash partitioning on enum columns.
- bc8cd50fefd3 16.0 landed
- 8f83ce8c5244 12.15 landed
- 7e7c5b683985 13.11 landed
- 5fc1ac151d85 14.8 landed
- 2b216da1e55d 15.3 landed
- 012ffb365a05 11.20 landed