Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 430032E0032 for ; Tue, 29 Apr 2008 12:04:38 -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 18006-06 for ; Tue, 29 Apr 2008 12:04:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ops04.ec.mht1.renesys.com (ops04.ec.mht1.renesys.com [69.84.130.144]) by developer.postgresql.org (Postfix) with ESMTP id CD5062E002D for ; Tue, 29 Apr 2008 12:04:33 -0300 (ADT) Received: (qmail 23962 invoked by uid 215); 29 Apr 2008 15:04:32 -0000 Date: Tue, 29 Apr 2008 15:04:32 +0000 From: John Rouillard To: pgsql-performance@postgresql.org Subject: Re: Very poor performance loading 100M of sql data using copy Message-ID: <20080429150432.GO6622@renesys.com> References: <20080428172431.GI6622@renesys.com> <48160F05.2090207@enterprisedb.com> <20080428180053.GL6622@renesys.com> <48162A67.3090500@Sheeky.Biz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48162A67.3090500@Sheeky.Biz> User-Agent: Mutt/1.4.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/444 X-Sequence-Number: 29937 On Tue, Apr 29, 2008 at 05:19:59AM +0930, Shane Ambler wrote: > 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? Yes it's a one off bulk data load of many days of data. The daily loads will also take 3 hour's but that is ok since we only do those once a day so we have 21 hours of slack in the schedule 8-). > >>>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. Hmm, interesting idea, worth considering if we have to do this again (I hope not). Thaks for the reply. -- -- rouilj John Rouillard System Administrator Renesys Corporation 603-244-9084 (cell) 603-643-9300 x 111