Re: improve performance of pg_dump with many sequences
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Euler Taveira <euler@eulerto.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-07-17T18:48:00Z
Lists: pgsql-hackers
On Tue, Jul 16, 2024 at 10:23:08PM -0500, Nathan Bossart wrote: > On Wed, Jul 17, 2024 at 11:30:04AM +0900, Michael Paquier wrote: >> Yeah, I have bumped on the same issue. In the long term, I also think >> that we'd better have pg_sequence_last_value() return a row with >> is_called and the value scanned. As you say, it won't help except >> when upgrading from versions of Postgres that are at least to v18, >> assuming that this change gets in the tree, but that would be much >> better in the long term and time flies fast. > > AFAICT pg_sequence_last_value() is basically an undocumented internal > function only really intended for use by the pg_sequences system view, so > changing the function like this for v18 might not be out of the question. > Otherwise, I think we'd have to create a strikingly similar function with > slightly different behavior, which would be a bizarre place to end up. On second thought, I worry that this change might needlessly complicate the pg_sequences system view. Maybe we should just add a pg_sequence_get_tuple() function that returns everything in FormData_pg_sequence_data for a given sequence OID... -- nathan
Commits
-
pg_dump: Fix gathering of sequence information.
- 7a485bd641b7 19 (unreleased) landed
- 39d55557661f 18.2 landed
-
Improve performance of dumpSequence().
- 68e962998598 18.0 landed
-
Improve performance of dumpSequenceData().
- bd15b7db489d 18.0 landed
-
Introduce pg_sequence_read_tuple().
- c8b06bb969bf 18.0 landed
-
Parse sequence type and integer metadata in dumpSequence().
- 23687e925f94 18.0 landed