I don't see any reason in principle why LoptOptimizeJoinRule could not handle semi-joins. Of course it will have to remember that these are semi-joins so that it can re-create them as semi-joins afterwards. And there may be complications because a semi-join eliminates duplicates in its right-hand input (or rather, the number of rows is not multiplied if a key has multiple values) and therefore moving a semi-join up and down the join graph may not affect row-counts in the expected way.
It's certainly beneficial to push semi-joins down in many cases. Julian On Fri, Jan 11, 2019 at 8:41 PM hanu mapr <[email protected]> wrote: > > Hello all, > > I am working on an issue wherein one of the tpcds query is regressing when > semijoin is also present with other inner joins in the query. Currently, > DRILL uses LoptOptimizeJoinRule for join order optimization. During the > debugging process, I observed that LoptOptimizeJoinRule is not considering > semi joins for join order optimization. > Please do let me know if my understanding is correct. If so what is the > best option for handling this scenario?. > > Thanks in advance. > > Regards, > -Hanu
