Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by hub.org (8.10.1/8.10.1) with ESMTP id e7UGOQC08859 for ; Wed, 30 Aug 2000 12:24:26 -0400 (EDT) Received: from ipinc.com (jliang.ipinc.com [199.245.188.130]) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id JAA64033; Wed, 30 Aug 2000 09:24:12 -0700 (PDT) (envelope-from jliang@ipinc.com) Message-ID: <39AD34BE.74717395@ipinc.com> Date: Wed, 30 Aug 2000 09:22:22 -0700 From: Jie Liang Organization: ipinc.com X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Stephan Szabo CC: pgsql-sql@postgresql.org Subject: Re: Optimizing huge inserts/copy's References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200008/342 Hi, there, I tried different ways, include vaccum table , ensure index works, it still is as slow as ~100rows per minute. Stephan Szabo wrote: > On Tue, 29 Aug 2000, Jie Liang wrote: > > > Hi, there, > > > > 1. use copy ... from '.....'; > > 2. write a PL/pgSQL function and pass multiple records as an array. > > > > However, if your table have a foreign key constraint, it cannot be speed > > up, > > > > I have same question as you, my table invloving 9-13 million rows, I > > don't > > know how can I add a foreign key them also? > > I haven't tried it on really large tables, but does it turn out faster to > use ALTER TABLE ADD CONSTRAINT to add the foreign key constraint after the > data is loaded and the indexes are created? -- Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com