X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D28269FA2D8 for ; Wed, 24 May 2006 16:00:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 22573-02 for ; Wed, 24 May 2006 16:00:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 3E6E79FA3AD for ; Wed, 24 May 2006 16:00:14 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 24 May 2006 19:00:10 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 24 May 2006 14:00:10 -0500 Subject: Re: Restore of pg_dump taking a long time... From: Scott Marlowe To: "mcelroy, tim" Cc: 'Tom Lane' , Ruairi , pgsql-admin@postgresql.org In-Reply-To: <9765373733A7DF4681B12225D2FC44050D6CE9@bosexprod001.bostonstock.local> References: <9765373733A7DF4681B12225D2FC44050D6CE9@bosexprod001.bostonstock.local> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1148497210.25526.22.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 24 May 2006 14:00:10 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/340 X-Sequence-Number: 21872 On Wed, 2006-05-24 at 13:56, mcelroy, tim wrote: > I have found that the following steps have increased the speed of my > restores: > 1. dropdb > 2. createdb > 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 (on a Linux box) <= This step can be > performed while the restore is running but you need root privilege Note that if there's no other data in the database that you need to worry about, you can also restore with fsync off. I.e. if a database cluster could just be re-inited should a power failure occur. If you've got already important data you can't afford to lose in the cluster, then do not turn off fsync. Also, remember to turn it back on before you go into production.