X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5AB2752814 for ; Thu, 14 Jul 2005 12:41:53 -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 21780-01 for ; Thu, 14 Jul 2005 15:41:46 +0000 (GMT) Received: from noao.edu (noao.edu [140.252.1.54]) by svr1.postgresql.org (Postfix) with ESMTP id 88A5252D8D for ; Thu, 14 Jul 2005 12:41:43 -0300 (ADT) X-TFF-CGPSA-Version: 1.4f1 X-TFF-CGPSA-Filter: Scanned Received: from [140.252.14.8] (HELO weaver.tuc.noao.edu) by noao.edu (CommuniGate Pro SMTP 4.3.6) with ESMTPS id 19334002; Thu, 14 Jul 2005 08:41:36 -0700 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by weaver.tuc.noao.edu (8.13.1/8.13.1) with ESMTP id j6EFfaIk001063; Thu, 14 Jul 2005 08:41:36 -0700 Message-ID: <42D687B0.6040009@noao.edu> Date: Thu, 14 Jul 2005 08:41:36 -0700 From: Steve Wampler User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org Subject: Re: Inserting a large number of records References: <42D67384.1030001@cfdev.com> <42D67F4E.20204@opencloud.com> In-Reply-To: <42D67F4E.20204@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/81 X-Sequence-Number: 13229 Oliver Jowett wrote: > Greg Alton wrote: > >>What is the most efficient way to insert a large number of records into >>a table? > > > I use a PreparedStatement INSERT and addBatch() / executeBatch() with > autocommit off and no constraints or indexes present. Does anyone have an idea as to how the performance of this would compare to using a COPY? I've used the COPY patches with jdbc and 7.4.x with impressive results, but if the above is 'nearly' as good then I don't have to put off upgrading to 8.x while waiting on jdbc to officially include support for COPY. (I can't test the above right now. Maybe soon, though.) Thanks! Steve -- Steve Wampler -- swampler@noao.edu The gods that smiled on your birth are now laughing out loud.