Received: from web803.mail.yahoo.com (web803.mail.yahoo.com [128.11.23.63]) by hub.org (8.10.1/8.10.1) with SMTP id e7UIsJC02797 for ; Wed, 30 Aug 2000 14:54:19 -0400 (EDT) Received: (qmail 12823 invoked by uid 60001); 30 Aug 2000 18:57:17 -0000 Message-ID: <20000830185717.12822.qmail@web803.mail.yahoo.com> Received: from [63.169.132.205] by web803.mail.yahoo.com; Wed, 30 Aug 2000 11:57:17 PDT Date: Wed, 30 Aug 2000 11:57:17 -0700 (PDT) From: Webb Sprague Subject: Re: Optimizing huge inserts/copy's To: Jie Liang , Stephan Szabo Cc: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200008/343 I am experimenting with this too. If I have any indexes at all, the copy's get VERY SLOW as the table gets big. Delete ALL your indexes, do your copy's, and then create your indexes again. Good luck. --- Jie Liang wrote: > 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 > > > __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/