X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3A28C3A4639 for ; Thu, 11 Nov 2004 17:06:21 +0000 (GMT) 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 35984-09 for ; Thu, 11 Nov 2004 17:06:18 +0000 (GMT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by svr1.postgresql.org (Postfix) with ESMTP id 23FD73A4865 for ; Thu, 11 Nov 2004 15:23:01 +0000 (GMT) Received: from trofast.sesse.net (trofast.sesse.net [129.241.93.32]) by svr4.postgresql.org (Postfix) with ESMTP id C2F705AF348 for ; Thu, 11 Nov 2004 10:16:17 +0000 (GMT) Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1CSBoQ-0002g3-00 for ; Thu, 11 Nov 2004 11:04:18 +0100 Date: Thu, 11 Nov 2004 11:04:18 +0100 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: How to speed-up inserts with jdbc Message-ID: <20041111100418.GA2116@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <003201c4c68e$8d347ee0$a702a8c0@shanepc> <41921CFD.7060604@webde-ag.de> <376dd19504111100044aa0ca1e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <376dd19504111100044aa0ca1e@mail.gmail.com> X-Operating-System: Linux 2.6.8.1 on a i686 User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/181 X-Sequence-Number: 9135 On Thu, Nov 11, 2004 at 04:04:06PM +0800, Edwin Eyan Moragas wrote: > how about using PreparedStatment? that's on the java end. > on the pg end, maybe do a BEGIN before the for loop and > END at the end of the for loop. You don't even need a "BEGIN" and "END"; his code has a setAutoComit(true) before the for loop, which just has to be changed to setAutoCommit(false) (and add an explicit commit() after the for loop, of course). /* Steinar */ -- Homepage: http://www.sesse.net/