Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 837FD9FB1B9 for ; Mon, 8 Jan 2007 05:41:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 51910-07 for ; Mon, 8 Jan 2007 05:41:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id 59F099FA3DA for ; Mon, 8 Jan 2007 05:41:35 -0400 (AST) Received: by fafnir.androme.com (Postfix, from userid 1003) id 8874AB91D5D; Mon, 8 Jan 2007 10:41:33 +0100 (CET) Message-ID: <45A211CC.80003@andromeiberica.com> Date: Mon, 08 Jan 2007 10:41:32 +0100 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Problems restoring big tables References: <459E7D83.3030307@andromeiberica.com> <25554.1168052565@sss.pgh.pa.us> In-Reply-To: <25554.1168052565@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/60 X-Sequence-Number: 24216 Hi all, >> I have to restore a database that its dump using custom format (-Fc) >> takes about 2.3GB. To speed the restore first I have restored everything >> except (played with pg_restore -l) the contents of some tables that's >> where most of the data is stored. > > I think you've outsmarted yourself by creating indexes and foreign keys > before loading the data. That's *not* the way to make it faster. I made a mistake saying that I wanted to speed the restore. What I really meant is the following. I have to migrated that DB from a server to another, that means I have to stop my production environment. Those big tables are not really needed to be on production as they are only statistical data. So what I wanted to do is first of all restore the important tables and at the end restore the statistics. So what's the way to do this? > >> pg_restore: ERROR: out of memory >> DETAIL: Failed on request of size 32. >> CONTEXT: COPY statistics_operators, line 25663678: "137320348 58618027 > > I'm betting you ran out of memory for deferred-trigger event records. > It's best to load the data and then establish foreign keys ... indexes > too. See > http://www.postgresql.org/docs/8.2/static/populate.html > for some of the underlying theory. (Note that pg_dump/pg_restore > gets most of this stuff right already; it's unlikely that you will > improve matters by manually fiddling with the load order. Instead, > think about increasing maintenance_work_mem and checkpoint_segments, > which pg_restore doesn't risk fooling with.) Thank you very much -- Arnau