Reputation: 293
I have a native query inside my Java Spring application that hits an oracle DB and fetches a large resultset (close to 20000 records). Current approach is that I used Spring's JdbcTemplate to execute the query, which takes about few minutes to execute the query. What will be the better approach to improve the performance in executing this query?
Upvotes: 0
Views: 1480
Reputation: 44952
Find the bottleneck before optimizing. If 90% time is spent materializing results, 9% transferring data over your network and 1% in simple Java operations there is no point to optimize Java.
Oracle docs chapter "21 Using Application Tracing Tools" explains database server side tracing. This and EXPLAIN statement is a good starting point.
Upvotes: 1
Reputation: 13471
I guess pagination is not an option right?.
http://www.javacodegeeks.com/2013/01/spring-data-jpa-and-pagination.html
In any case you gonna have a bottleneck since you´re not using BigData tecnologies as NoSQL DB as Mongo or Casandra.
Take a look just in case if it´s possible.
http://www.springio.net/creating-big-data-applications-with-spring-xd/
Upvotes: 1