-->
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.  [ 4 posts ] 
Author Message
 Post subject: max_fetch_depth confusion
PostPosted: Thu May 06, 2004 4:00 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
From the 2.1.3 doco:
Quote:
Set a maximum "depth" for the outer join fetch tree for single-ended associations (one-to-one, many-to-one). A 0 disables default outer join fetching.


Found in the forums, posted by Gavin:
Quote:
max_fetch_depth specifies the maximum depth we will ever fetch into the object graph. This can occasionally be slightly unpredictable. It certainly does not put a bound in the number of outer joins!
http://forum.hibernate.org/viewtopic.php?t=928842

So, now I'm really confused.
Can someone please exaplain to me the difference between these two things:
"setting maximum depth of the outer joing fetch tree"
and
"putting a bound in the number of outer joins"

The FAQ says that setting max_fetch_depth to a "smaller value" can help solve the issue of
Quote:
"Hibernate generates too many outer joins"
.

Anyway, the original reason I started looking at this is that I wanted to know why the recommended max for this setting is 3?
Back when I thought I knew what this setting meant, it occurred to me that 3 is a pretty low number and I was wondering why the Hibernate team recommend it as the maximum we should use?

Also, what's the default? If I don't set the property at all, is it just unlimited?

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 10:40 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
boink

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject: Re: max_fetch_depth confusion
PostPosted: Wed May 12, 2004 3:22 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
stolley wrote:
Can someone please exaplain to me the difference between these two things:
"setting maximum depth of the outer joing fetch tree"
and
"putting a bound in the number of outer joins"


stolley, English is not my native language :), but as I got those two expression mean the same, that is "setting maximum depth of the outer joing fetch tree"=="putting a bound in the number of outer joins"

stolley wrote:
The FAQ says that setting max_fetch_depth to a "smaller value" can help solve the issue of
Quote:
"Hibernate generates too many outer joins"
.

For example if you use MySQL or some other RDMS with limited number of outer joins per SQL request you need to "put a bound in the number of outer joins"

stolley wrote:
Anyway, the original reason I started looking at this is that I wanted to know why the recommended max for this setting is 3?
Back when I thought I knew what this setting meant, it occurred to me that 3 is a pretty low number and I was wondering why the Hibernate team recommend it as the maximum we should use?


I think that magic number 3 was chosen maybe because all supported RDBMS that knows about outer joins support 3 outer joins per SQL request.

stolley wrote:
Also, what's the default? If I don't set the property at all, is it just unlimited?


In Hibernate 2.1.2 as I know the default value is infinity :)
With PostreSQL our team uses the default value of max_fetch_depth, we ran some performance test with max_fetch_depth set to 3, 5, 10 and decided that devault (unlimited) value for the PostreSQL is the optimal one

Best regards,
Leonid


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 12, 2004 8:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
"Maximum fetched Graph depth" is not necessarily the same as "maximum number of outer joins". If fetching 3 objects deep, you may still get more than 3 outer joins, for example if you have joined-subclass mappings.

3 is a sensible default, because if you fetch deeper, the fetched result sets get really large ...


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