• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Scrollable result set cached by driver?  RSS feed

 
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?
 
author & internet detective
Marshal
Posts: 38506
653
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
Boost this thread!