Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8FCF39FB96D for ; Fri, 20 Apr 2007 08:39:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45195-04 for ; Fri, 20 Apr 2007 08:39:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by postgresql.org (Postfix) with ESMTP id 867579FB942 for ; Fri, 20 Apr 2007 08:39:38 -0300 (ADT) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HerSj-0003tA-28 for pgsql-jdbc@postgresql.org; Fri, 20 Apr 2007 04:39:37 -0700 Message-ID: <10099075.post@talk.nabble.com> Date: Fri, 20 Apr 2007 04:39:37 -0700 (PDT) From: femski To: pgsql-jdbc@postgresql.org Subject: Poor addBatch performance. Why dosn't it use copy ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: hypertree@yahoo.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/74 X-Sequence-Number: 16923 Folks ! I took this discussion in Postgres performance list and came out with conclusion that its a client side JDBC issue - so I am psting it here. I have a batch application that writes approx. 4 million rows into a narrow (2 column) table. I am using JDBC addBatch/ExecuteBatch with auto commit turned off. Batch size is 1000. So far I am seeing Postgres take roughly five times (280 sec) the time it takes to do this in the Oracle (60). This is on a Linux server with Xeon woodcrest 5310 process. Plenty of memory. I have played with many parameters on the server side and they seem to have little effect - I am sure Postgres is a very capable server and its not a database server issue. Someone mentioned: "I actually went and looked at the JDBC api and realized 'addBatch' means to run multiple stmts at once, not batch inserting. femski, your best bet is to lobby the JDBC folks to build support for 'copy' into the driver for faster bulk loads (or help out in that regard). " Based on other responses I am convinced this is indeed the problem and I think its a pretty serious limitation. Why doesn't the Postgres JDBC driver use "copy" for faster bulk insert ? What is the best way to speedup do bulk insert at this time or in near future (I was to use standard JDBC API) ? Thank you, -Sanjay -- View this message in context: http://www.nabble.com/Poor-addBatch-performance.-Why-dosn%27t-it-use-copy---tf3616055.html#a10099075 Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.