-->
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: Many-to-one performance
PostPosted: Tue Apr 29, 2008 6:17 am 
Beginner
Beginner

Joined: Thu Oct 25, 2007 3:45 am
Posts: 22
Hi,

I need to achieve better performance when loading objects using NHibernate.

Here is the case:
Objects of type Class1 need to be loaded. Just load all of them. This class has a many-to-one relation with Class2:

<many-to-one name="Cl2"
class="Class2"
column="Class2ID" cascade="none" />

There are a few objects of Class1 and they are quite simple. When there are not many objects of Class2 in the database, the loading is fast. But when they are more than 1000 (actually even more are needed) the loading takes about 4-5 minutes. That's really not acceptable :).

Please, help me with the solution of this.


Top
 Profile  
 
 Post subject: Many-to-one performance
PostPosted: Thu May 01, 2008 4:36 am 
Senior
Senior

Joined: Thu Jun 21, 2007 8:03 am
Posts: 127
Location: UK
Hi,

Can you post the code you are using to load the objects?

Is it possible that you are running into the classic SELECT N+1 problem? (http://www.ayende.com/Blog/archive/7627.aspx)

Regards,
Richard


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.