pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: femski <hypertree@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: Poor addBatch performance. Why dosn't it use copy ?
Date: Fri, 20 Apr 2007 04:39:37 -0700 (PDT)
Message-ID: <10099075.post@talk.nabble.com> (raw)


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.




view thread (5+ messages)  latest in thread

Message-ID: <10099075.post@talk.nabble.com>
Permalink:  ../10099075.post@talk.nabble.com/
Also on:    postgresql.org/message-id/10099075.post@talk.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: hypertree@yahoo.com
  Subject: Re: Poor addBatch performance. Why dosn't it use copy ?
  In-Reply-To: <10099075.post@talk.nabble.com>
  References: <10099075.post@talk.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox