-->
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.  [ 5 posts ] 
Author Message
 Post subject: Outer join fetching for interface based queries.
PostPosted: Wed Apr 21, 2004 11:48 pm 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:47 pm
Posts: 44
I appreciate hibernate's ability to query an interface. I would like to request a feature in the name of performance on these types of queries.

In some object hierarchies, querying an interface can be quite exhaustive because hibernate performs a separate SQL query for every single class that implements the interface. In a current project, for example, hibernate is generating about 15 separate SQL queries when querying an interface.

Could outer join fetching help performance here -- join all of the queries together into one big SQL statement instead of several individual statements?

Just a thought, and if possible, then a feature suggestion. :)

Best regards,

Ryan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 22, 2004 4:00 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This will be most likely a deoptimization.
Such a huge SQL statement will take time to generate, send through the network, process by hibernate (distinct of duplicated objects)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 22, 2004 11:36 am 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:47 pm
Posts: 44
Hi emmanuel,

I guess I'm not perceiving it the same way.

- For generation, it couldn't be that much more complicated than string concatenation to join all of the separate statements together??

- Except for the extra join information, network time would seem to be reduced because you would have one SQL statement hitting the server instead of 15 (for example). The amount of physical text traversing the network would be about the same.

- As far as I understand, there shouldn't be any more risk of duplicate objects than there are when running the sql statements individually -- you're still hitting separate tables and/or discriminators. ?

Best regards,

Ryan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 22, 2004 4:42 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
from MyInterface

Impl1 = 50 rows
Impl2 = 50 rows
Impl3 = 50 rows
Impl4 = 50 rows

left outer joining altogether return a resultset of 6 250 000 rows. sounds bad to me.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 22, 2004 7:45 pm 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:47 pm
Posts: 44
Thanks for the clarification! I get it now! You're right, that wouldn't be very desirable. :)

Best regards,

Ryan


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