-->
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: Performance of Collections
PostPosted: Thu May 05, 2011 3:49 pm 
Newbie

Joined: Thu May 05, 2011 3:41 pm
Posts: 2
I have a question about the performance of Hibernate collections. It is my understanding that before inserting a new record in to a "many" side of a Set or List collection, Hibernate needs to first load all the instances from the database into memory (ensure there are no duplicates for a Set and keep them in order for List). So, it therefore doesn't make sense to use Set and List for very large collections because there will be a big performance hit selecting all the rows in the child table for every insert.

What is the largest recommended collection size for Set and List given this issue? Is the recommendation to always use Bag for very large collections? Can't the Set collection be optimized by using "unique" in the database as opposed to reading the entire table into memory each time? Please let me know.


Top
 Profile  
 
 Post subject: Re: Performance of Collections
PostPosted: Fri May 13, 2011 11:36 am 
Newbie

Joined: Thu May 05, 2011 3:41 pm
Posts: 2
Any thoughts?


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.