Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id D554B2E003D for ; Mon, 28 Apr 2008 16:50:12 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 60926-04 for ; Mon, 28 Apr 2008 16:50:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by developer.postgresql.org (Postfix) with ESMTP id A1CF42E0032 for ; Mon, 28 Apr 2008 16:50:05 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsgEAM7GFUjLevdH/2dsb2JhbACBU6pT X-IronPort-AV: E=Sophos;i="4.25,718,1199626200"; d="scan'208";a="91209691" Received: from ppp247-71.static.internode.on.net (HELO DevBox.local) ([203.122.247.71]) by ipmail01.adl6.internode.on.net with ESMTP; 29 Apr 2008 05:20:01 +0930 Message-ID: <48162A67.3090500@Sheeky.Biz> Date: Tue, 29 Apr 2008 05:19:59 +0930 From: Shane Ambler User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: John Rouillard CC: pgsql-performance@postgresql.org Subject: Re: Very poor performance loading 100M of sql data using copy References: <20080428172431.GI6622@renesys.com> <48160F05.2090207@enterprisedb.com> <20080428180053.GL6622@renesys.com> In-Reply-To: <20080428180053.GL6622@renesys.com> 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: 200804/412 X-Sequence-Number: 29905 John Rouillard wrote: > We can't do this as we are backfilling a couple of months of data > into tables with existing data. Is this a one off data loading of historic data or an ongoing thing? >>> The only indexes we have to drop are the ones on the primary keys >>> (there is one non-primary key index in the database as well). If this amount of data importing is ongoing then one thought I would try is partitioning (this could be worthwhile anyway with the amount of data you appear to have). Create an inherited table for the month being imported, load the data into it, then add the check constraints, indexes, and modify the rules/triggers to handle the inserts to the parent table. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz