Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Break query execution into multiple steps to reduce the response time

 
Kamal Bahadur
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am facing a problem. I have a JSP page which has to display records from a Database. My query retrieves around 1 lakh records. It takes 10 minutes to build the ResultSet. I believe this much of response time is not good for any web based application. Is there any way to retrieve records in multiples of hundreds. so that the response time is reduced.

Thanks and Regards
Kamal
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your SQL query sort the records on one of the fields? If so, you could add something to your WHERE clause that narrows it down to a certain range. Something like:

I chose the numbers 0 and 100 as an example. Most likely this would be a "blank" that can be filled in with Java code. Also, depending on the values for sortField, this probably won't guarantee that each result set will return the same number of records.

HTH

Layne
 
Virag Saksena
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a page which displays 100,000 records ?

Would someone ever look at that much data ?

Are you aggregating the data in Java to only provide summaries ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic