Re: improve performance of pg_dump with many sequences
Euler Taveira <euler@eulerto.com>
From: "Euler Taveira" <euler@eulerto.com>
To: "Nathan Bossart" <nathandbossart@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-07-11T02:52:33Z
Lists: pgsql-hackers
On Wed, Jul 10, 2024, at 7:05 PM, Nathan Bossart wrote: > I'm not following why that would be a better approach. strncpy() will add > a NUL to the end of the string unless it doesn't fit in the buffer, in > which case we'll add our own via "seqtype[sizeof(seqtype) - 1] = '\0'". > Furthermore, the compiler can determine the position where the NUL should > be placed, whereas placing it at the end of the copied string requires a > runtime strlen(). Nevermind, you are copying the whole buffer (n = sizeof(seqtype)). > Unfortunately, I think we have to keep this workaround since older minor > releases of PostgreSQL don't have the fix. Hmm. Right. > What pg_dump command did you test here? Did you dump the sequence data, or > was this --schema-only? time pg_dump -f - -s -d postgres -- Euler Taveira EDB https://www.enterprisedb.com/
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