-->
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.  [ 1 post ] 
Author Message
 Post subject: HQL vs, SQL left outer join speed
PostPosted: Fri Nov 22, 2013 8:35 am 
Newbie

Joined: Mon Jun 21, 2010 11:12 am
Posts: 1
Hi,

I have the following problem:
I have a query which is quick in SQL but extremely slow in HQL.
the structure is like this:

select
...
from
myTable
left outer join tableA as TA1 on myTable.id = TA1.owner_id
left outer join tableB as TB1 on TA1.id = TB1.owner_id
left outer join tableA as TA2 on myTable.id = TA2.owner_id
left outer join tableB as TB2 on TA2.id = TB2.owner_id
left outer join tableA as TA3 on myTable.id = TA3.owner_id
left outer join tableB as TB3 on TA3.id = TB3.owner_id
where
TB1.name='name1'
and TB2.name = 'name2'
and TB3.name='name3'

The size of the tables is cca:
myTable: 20.000
tableA : 3.000.000
tableB : 10.000

Thanks in advance:
Bianca


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.