Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0466163291E for ; Wed, 14 Jul 2010 13:58:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 02905-04 for ; Wed, 14 Jul 2010 16:58:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (unknown [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id DE4BD632768 for ; Wed, 14 Jul 2010 13:58:00 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id D013734803A; Wed, 14 Jul 2010 09:57:36 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B8wH2cG8lrM2; Wed, 14 Jul 2010 09:57:33 -0700 (PDT) Received: from [75.142.153.107] (unknown [75.142.153.107]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id D89F0348002; Wed, 14 Jul 2010 09:57:32 -0700 (PDT) Subject: Re: proper tuning for restoring from pg_dump in 8.3.7 From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: "Burgholzer, Robert (DEQ)" Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Organization: Command Prompt, Inc. Date: Wed, 14 Jul 2010 09:57:30 -0700 Message-ID: <1279126650.22775.9.camel@jd-desktop.unknown.charter.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201007/68 X-Sequence-Number: 35087 On Wed, 2010-07-14 at 12:33 -0400, Burgholzer, Robert (DEQ) wrote: > I am restoring a fairly sizable database from a pg_dump file (COPY FROM > STDIN style of data) -- the pg_dump file is ~40G. > > My system has 4 cores, and 12G of RAM. I drop, then recreate the > database, and I do this restore via a: cat dumpfile | psql db_name. The > trouble is that my system free memory (according to top) goes to about > 60M, which causes all operations on the server to grind to a halt, and > this 40G restore will take a couple hours to complete. > > I noted that the restore file doesn't do anything inappropriate such as > creating indices BEFORE adding the data or anything - thus I can only > suspect that my trouble has to do with performance tuning ineptitude in > postgresql.conf. The best you will get is ~ 22G an hour. If this is a backup you can take again in a different format, use -Fc and then use parallel restore. Even if half of the database is one table, you will still knock the restore time by 50% or so. Joshua D. Drake -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering