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 21A3F52C6D for ; Fri, 15 Jul 2005 08:47:48 -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 20669-06 for ; Fri, 15 Jul 2005 11:47:41 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id BA50A52BB2 for ; Fri, 15 Jul 2005 08:47:39 -0300 (ADT) Received: (qmail 1106 invoked from network); 15 Jul 2005 11:47:42 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 15 Jul 2005 11:47:42 -0000 In-Reply-To: <42D687B0.6040009@noao.edu> References: <42D67384.1030001@cfdev.com> <42D67F4E.20204@opencloud.com> <42D687B0.6040009@noao.edu> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6224A2D9-3B6F-4CFB-A69D-0CAB8DDBE94C@fastcrypt.com> Cc: Oliver Jowett , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Inserting a large number of records Date: Fri, 15 Jul 2005 07:47:42 -0400 To: Steve Wampler X-Mailer: Apple Mail (2.733) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.016 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/95 X-Sequence-Number: 13243 Here's a version ( a little old ) of the driver with copy implemented. http://download.postgresintl.com/copy.tar.gz Dave On 14-Jul-05, at 11:41 AM, Steve Wampler wrote: > 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. > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that > your > message can get through to the mailing list cleanly > >