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.  [ 3 posts ] 
Author Message
 Post subject: Poor Perfornace in Lazy loading
PostPosted: Mon Feb 11, 2008 3:07 am 
Newbie

Joined: Mon Feb 11, 2008 2:45 am
Posts: 5
Location: Bangalore
NHibernate version: v2.0.50727
Name and version of the database: SQL Server 2005


Hello friends,
I am facing performance issue with lazy loading.
Here is scenario:
I had a table "Work" with around 100 fields. I have setup 5 "many-to-one" for which foreign key doesn't exist in database (which should be but bad database design!!). 1 "many-to-one" relationship with itself (self reference).
"Work" table has around 15000 entries.

When I load mentioned 5 "many-to-one" relationships lazily, it takes considerably more time. I takes less time (10 time less) when I set lazy="false" in HBM. Memory usage is also too much in lazy loading (takes 500 MB)

These 5 tables have also around 50 to 70 columns.

May creating of proxy put more overhead than actually retrieving objects?
(actual retrieval is done through "select" on each table.. no join).

Please guide.

Thanks in advanced,

- Yogendrasinh


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 12:51 pm 
Regular
Regular

Joined: Tue Dec 25, 2007 3:41 pm
Posts: 57
Location: Argentina
Please, can you send a test case to reproduce this ?

Thanks.

_________________
Dario Quintana


Top
 Profile  
 
 Post subject: Re: Poor Perfornace in Lazy loading
PostPosted: Mon Feb 11, 2008 1:58 pm 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Do the relations actually get fetched? If Yes, this behavior is to be expected. one Join should be way faster then thousands of selects.

For determination what really is going on include the sql-logging of hibernate along with the code snippet

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.