-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Best approch to fetch 1000 records
PostPosted: Thu Mar 25, 2004 12:33 pm 
Beginner
Beginner

Joined: Wed Mar 03, 2004 4:56 pm
Posts: 29
Hi


What is the best approch in hibernate when a query is going to give 1000 objects in a result set? Executing this query takes a lot of time.

Thanks
Yogs


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 25, 2004 6:31 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
the best way is to have the best mapping and only retrieve the part a the graph you need.

1st: use .list() instead of .iterate()
2nd: use lazy=true for to-many relations if you don't need the lists to be loaded
3rd: use proxy (and outer-join=false) for to-one relation to block the load of your object graph


and before all this
read the doc and of course the part that deals with performance....

number of sql queries generated can show you if your mapping is optimized for your issue (but that's not always so easy to see)

good luck


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.