Re: Allowing parallel pg_restore from pipe

From: Shaun Thomas <sthomas(at)optionshouse(dot)com>
To: Timothy Garnett <tgarnett(at)panjiva(dot)com>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allowing parallel pg_restore from pipe
Date: 2013-04-25 21:06:45
Message-ID: 51799AE5.8060408@optionshouse.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)optionshouse(dot)com

______________________________________________

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-04-25 22:04:10 Re: Bug Fix: COLLATE with multiple ORDER BYs in aggregates
Previous Message Timothy Garnett 2013-04-25 20:01:38 Re: Allowing parallel pg_restore from pipe