By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,279 Members | 1,670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,279 IT Pros & Developers. It's quick & easy.

JDBC batch inserts seem very slow.

P: n/a
We are prototyping an application that is inserting 500 rows into a
table. One method is to using batching and make one database call to
insert all 500 rows, the other method is to make 500 database calls
insert 1 row each time. The problem is that the batching method is
about 20% slower. Does anyone have any insights as to why this is the
case? I was expecting the batching to be faster.

DB2 9 on AIX 5.3 64 bit.

Thanks!

Aug 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Private Pyle" <lp*****@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
We are prototyping an application that is inserting 500 rows into a
table. One method is to using batching and make one database call to
insert all 500 rows, the other method is to make 500 database calls
insert 1 row each time. The problem is that the batching method is
about 20% slower. Does anyone have any insights as to why this is the
case? I was expecting the batching to be faster.

DB2 9 on AIX 5.3 64 bit.

Thanks!
Can you explain exactly what you mean by batching, and provide a sample of
your insert?
Aug 23 '06 #2

P: n/a
On Wed, 23 Aug 2006 14:55:20 -0700, Private Pyle wrote:
We are prototyping an application that is inserting 500 rows into a
table. One method is to using batching and make one database call to
insert all 500 rows, the other method is to make 500 database calls
insert 1 row each time. The problem is that the batching method is
about 20% slower. Does anyone have any insights as to why this is the
case? I was expecting the batching to be faster.

DB2 9 on AIX 5.3 64 bit.

Thanks!
In my case, on 64 bit Linux server, 32 bit Linux clients, (also 9.1) there
is a huge improvement when using jdbc batch inserts. Possibly your client
IBM jdbc drivers (ver 9.1 has new drivers).
Also, maybe your jvm needs more ram (jdbc uses more ram for all records in batch,
as opposed to releasing each to gc the regular way) and is the bottleneck.
-nat

Aug 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.