Re: Allowing parallel pg_restore from pipe - Mailing list pgsql-hackers

From Shaun Thomas
Subject Re: Allowing parallel pg_restore from pipe
Date
Msg-id 51799AE5.8060408@optionshouse.com
Whole thread Raw
In response to Re: Allowing parallel pg_restore from pipe  (Timothy Garnett <tgarnett@panjiva.com>)
Responses Re: Allowing parallel pg_restore from pipe
List pgsql-hackers
On 04/25/2013 12:56 PM, Timothy Garnett wrote:

> As the OP, I'll just note that my organization would definitely find use
> for a parallel migrator tool as long as it supported doing a selection
> of tables (i.e. -t / -T) in addition to the whole database and it
> supported or we were able to patch in an option to cluster as part of
> the migration (the equivalent of something like
> https://github.com/tgarnett/postgres/commit/cc320a71 ).

If you need something like this short term, we actually found a way to 
do it ourselves for a migration we performed back in October. The secret 
is xargs with the -P option:

xargs -I{} -P 8 -a table-list.txt \    bash -c "pg_dump -Fc -t {} my_db | pg_restore -h remote -d my_db"

Fill table-list.txt with as many, or as few tables as you want. The 
above example would give you 8 parallel threads. Well equipped systems 
may be able to increase this.

Admittedly it's a gross hack, but it works. :)

-- 
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas@optionshouse.com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email



pgsql-hackers by date:

Previous
From: Timothy Garnett
Date:
Subject: Re: Allowing parallel pg_restore from pipe
Next
From: Tom Lane
Date:
Subject: Re: Bug Fix: COLLATE with multiple ORDER BYs in aggregates