470,596 Members | 1,596 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

JDBC batch inserts seem very slow.

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
2 2242
"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
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.

Similar topics

2 posts views Thread by Paul Reddin | last post: by
2 posts views Thread by Diego | last post: by
reply views Thread by JSParker1 | last post: by
1 post views Thread by chicago1985 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.