X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 370B25381E for ; Wed, 4 May 2005 08:08:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31465-07 for ; Wed, 4 May 2005 11:08:44 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205]) by svr1.postgresql.org (Postfix) with ESMTP id 45A735322A for ; Wed, 4 May 2005 08:08:43 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 68so238990wra for ; Wed, 04 May 2005 04:08:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=l6vw5U17ABPiHQzjdCnZwS4RKjEK7Xc7s5iiH46PZTqe5ATI4+Gq3LtNLpiePXgN52Q94paP3SOfhFNja0Btax5nrQXD8b7Y/2sGI8f3k1W68l4CR6GUszqF3X//4XecwTkHd1jNWMfXSShoI/0+r15Q7rp/BD4nGdxhze47U1M= Received: by 10.54.54.73 with SMTP id c73mr125777wra; Wed, 04 May 2005 04:08:47 -0700 (PDT) Received: by 10.54.150.14 with HTTP; Wed, 4 May 2005 04:08:46 -0700 (PDT) Message-ID: Date: Wed, 4 May 2005 11:08:46 +0000 From: Mike Rylander Reply-To: Mike Rylander To: Tom Lane Subject: Re: Cc: Steven Rosenstein , pgsql-perform In-Reply-To: <21154.1115136741@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <21154.1115136741@sss.pgh.pa.us> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.255 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/38 X-Sequence-Number: 12202 On 5/3/05, Tom Lane wrote: > Steven Rosenstein writes: > > My question is, are there any advantages, drawbacks, or outright > > restrictions to using multiple simultaneous COPY commands to load data = into > > the same table? >=20 > It will work; not sure about whether there is any performance benefit. > I vaguely recall someone having posted about doing this, so you might > check the archives. >=20 I may be one of Tom's vague "voices". ;) The only issue would be that you need to remove all you UNIQUE constraints before sending multiple COPYs to the server. This includes the PRIMARY KEY constraint. To the backend, COPY is just like INSERT and all constraints need to be checked and this will block the commit of one of the COPY streams. However, multiple COPYs may no be needed. I regularly load several table totaling around 50M rows with a single COPY per table. I drop (actually, this is during DB reload, so I don't yet create...) all fkeys, constraints and indexes and the data loads in a matter of 5 minutes or so. Hope that helps! --=20 Mike Rylander mrylander@gmail.com GPLS -- PINES Development Database Developer http://open-ils.org