Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fetching & Writing records problem using Oracle DB

 
Rithanya Laxmi
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Currently we are fetching 1 million records from Oracle DB , where we are using PreparedStatement and using the fetchSize() we are fetching the records in a "chunk" in an iterative manner and not feching all 1 million records at once. The same amount of records are passed to an utility to write the records in another DB table using addBatch() & batchUpdate() method. If the above operations in place, still the performance is not that great. Hence can we do the below:-

1) Caching the records and reusing it, the problem here is the data is dynamic and there is no static data involved here, hence whether caching works here? If so we can go with which caching mechanism?

2) Eventhough PreparedStatement is precompiled statement, is there any where we can have the SQL queries directly located to the database/prepared statement for the faster reading and writing of the data?

Here the SQL queries are pretty simple "select" and "Insert" query , hence there is no need to fine tune the queries. Please clarify how we can go about this?

Thanks.



 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the source and target table in the same database? If it is, the fastest way to do it is:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic