Re: Restore of pg_dump taking a long time...

From: "mcelroy, tim" <tim(dot)mcelroy(at)bostonstock(dot)com>
To: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ruairi <rcarroll(at)bluemetrix(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Restore of pg_dump taking a long time...
Date: 2006-05-24 18:56:30
Message-ID: 9765373733A7DF4681B12225D2FC44050D6CE9@bosexprod001.bostonstock.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I have found that the following steps have increased the speed of my
restores:
1. dropdb <DBNAME>
2. createdb <DBANME>
3. Increase maintenance_work_mem as Tom mentioned. I do this at
restore/runtime
4. Increase work_mem as Tom mentioned. I do this at restore/runtime
5. renice -20 -p <pid #> (on a Linux box) <= This step can be performed
while the restore is running but you need root privilege

Tim

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Wednesday, May 24, 2006 2:48 PM
To: Ruairi
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Restore of pg_dump taking a long time...

"Ruairi" <rcarroll(at)bluemetrix(dot)com> writes:
> I'm currently restoring a fairly large DB from a pg_dump and it's taking
> about 12 hours to finish. The main part of this time is spent creating
> indexes. Is there anyway I can speed up the restore process, or do i just
> have to wait?

There's not much you can do to improve the performance of a restore
already in progress. Next time you might want to think about kicking up
maintenance_work_mem before you start it; that's about the only thing
you can really do to speed up index builds.

(Actually, if there are lots of indexes yet to be built, increasing
the setting in postgresql.conf and SIGHUP'ing the postmaster could
be worth doing, as that should affect the builds yet to be done.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2006-05-24 19:00:10 Re: Restore of pg_dump taking a long time...
Previous Message Tom Lane 2006-05-24 18:47:31 Re: Restore of pg_dump taking a long time...