aspose file tools
The moose likes JDBC and the fly likes Limiting the Fetch Size Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Limiting the Fetch Size" Watch "Limiting the Fetch Size" New topic
Author

Limiting the Fetch Size

Ram Chhabra
Ranch Hand

Joined: Jan 07, 2008
Posts: 48
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

Joined: Apr 14, 2004
Posts: 10336

Why not limit your results set by specifying conditions in a where or having clause?

(also, what's a Lakh?)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ram Chhabra
Ranch Hand

Joined: Jan 07, 2008
Posts: 48
Thanks for your answer. After putting where clause also i am having 1 million of records. Then how to restrict.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

How about choosing conditions that limit your result set to a smaller size?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32694
    
    4
If I remember correctly lakh = 100,000.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Limiting the Fetch Size
 
Similar Threads
Using oracle Rownum with between keyword
Help with my homework please
Need Help with binding click events to table rows
HQL query problem
EJB QL - Changes with data in Table NOT REFLECTED