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 6BF88528C6 for ; Thu, 14 Jul 2005 14:20:32 -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 45086-03 for ; Thu, 14 Jul 2005 17:20:14 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 908D352BF7 for ; Thu, 14 Jul 2005 14:20:10 -0300 (ADT) Received: (qmail 20632 invoked from network); 14 Jul 2005 17:20:10 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 14 Jul 2005 17:20:10 -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: Cc: Oliver Jowett , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Inserting a large number of records Date: Thu, 14 Jul 2005 13:20:08 -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/84 X-Sequence-Number: 13232 It will never be as fast as COPY 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 > >