]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Clean up some minor inefficiencies in parallel dump/restore.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 1 Jun 2016 20:14:21 +0000 (16:14 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 1 Jun 2016 20:14:21 +0000 (16:14 -0400)
commit43d3fbe369088f089afd55847dde0f34b339b5f2
treef59d3ba1e77bee7dcf678fe0478d0f64839e4b32
parent47215c16f20631627ce0e1d78f5a592886c97b44
Clean up some minor inefficiencies in parallel dump/restore.

Parallel dump did a totally pointless query to find out the name of each
table to be dumped, which it already knows.  Parallel restore runs issued
lots of redundant SET commands because _doSetFixedOutputState() was invoked
once per TOC item rather than just once at connection start.  While the
extra queries are insignificant if you're dumping or restoring large
tables, it still seems worth getting rid of them.

Also, give the responsibility for selecting the right client_encoding for
a parallel dump worker to setup_connection() where it naturally belongs,
instead of having ad-hoc code for that in CloneArchive().  And fix some
minor bugs like use of strdup() where pg_strdup() would be safer.

Back-patch to 9.3, mostly to keep the branches in sync in an area that
we're still finding bugs in.

Discussion: <5086.1464793073@sss.pgh.pa.us>
src/bin/pg_dump/parallel.c
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_dump.c