This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Limiting the Fetch Size

 
Ram Chhabra
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to check that does something exist in some specified table or not. For that i can run query like ... but my problem is that mytable consist 10 Lakhs of records.

I only need to check that is any single record exist or not.... Can i use setFetchSize() or something else... can you please suggest what policy should i opt to improve performance

Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not limit your results set by specifying conditions in a where or having clause?

(also, what's a Lakh?)
 
Ram Chhabra
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer. After putting where clause also i am having 1 million of records. Then how to restrict.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about choosing conditions that limit your result set to a smaller size?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49776
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I remember correctly lakh = 100,000.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic