pgsql: Clean up some minor inefficiencies in parallel dump/restore. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Clean up some minor inefficiencies in parallel dump/restore.
Date
Msg-id E1b8CXM-0004FK-AO@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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>

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c2df9ccd97e88f9a353f8f8023383a23ebced27b

Modified Files
--------------
src/bin/pg_dump/parallel.c           | 26 +-------------------------
src/bin/pg_dump/pg_backup_archiver.c | 18 +++++++-----------
src/bin/pg_dump/pg_dump.c            | 32 +++++++++++++++++++++-----------
3 files changed, 29 insertions(+), 47 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: doc: Update version() and current_date output in tutorial
Next
From: Tom Lane
Date:
Subject: pgsql: Clean up some minor inefficiencies in parallel dump/restore.