• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scrollable result set cached by driver?

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently we found a problem that Oracle JDBC driver simulates scrolling operations in result set by caching entire result in memory. Certainly it rises a problem for multi million result. How do you resolve problem of:
1. getting number of record in result set?
2. scrolling to first shown record?

Is rs.next() perform well, or some other trick like including max(rownum) in a query will work better?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by D Rog:
Is rs.next() perform well, or some other trick like including max(rownum) in a query will work better?

rs.next() is inefficient if all you need is the count. rs.next() results in a lot of network traffic and extra work that is not required to get the count.

Also, select count(*) from .... is more efficient than max(rownum)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic