最適化したいHQLクエリが機能しています。それは次のとおりです。
select distinct A.id from Import as A, Place D
where (A.place=D or A.placeBOK=D) and D.country=?
I tried to replcae the query from above by the following:
select distinct A.id from Import as A
where A.place.country=? or A.placeBOK.country=?
パフォーマンスに加えて、両方のクエリは同等だと思いました。しかし、そうではありません。1つ目は20個のオブジェクトのセットを配信するのに対し、2つ目は14個のオブジェクトのみを配信します。
私は何が間違っているのですか?
ヒントはありますか?