• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

fast performance in jdbc insert

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to insert some 1 to 10 million records in oracle database.I am using
connection pool and prepared statement for this purpose.I have 3 different types of objects and data from them is inserted to 3 tables in database.I am making a batch of 200 for each query(3 total) and i am getting 4000 ms as total time to execute one batch.2500 ms is taken to commit batch to database and 1500 ms for constructing prepare statement for 3 batch.
Please tell me how i can improve my performance.

Thanks
Monu G
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Monu,
Welcome to JavaRanch!

Do you have any indexes on the table? If so, I would consider dropping them during the large data insert. Also, look for contention on the database.

The prepared statement part should only be done once, since subsequent batches are of the same size. For the other part, I would suggest looking at the db statistics to see what is taking all the time. 2.5seconds to insert 200 rows sounds like a lot.
 
monu garg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ,Jeanne.
I was printing jdbc log which was taking much of time.


Monu G
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic