Jackie-Jiang commented on PR #14758: URL: https://github.com/apache/pinot/pull/14758#issuecomment-2580790276
> > Only the queries with right `DISTINCT` and no right project regular join can be rewritten to SEMI join. IMO we shouldn't allow such auto-rewrite because it doesn't guarantee better performance. Queries written as regular join should be executed as regular join; written as semi join should be executed as semi join. > > The query mentioned in the PR description is already planned as a Semi join in the query plan. Because it matches the conditions above: right side of JOIN has distinct values; there is no project to right side after join. The rewrite is done by `CoreRules.PROJECT_TO_SEMI_JOIN`, so I'm thinking maybe we should remove this rule, and only allow explicit SEMI join by using IN clause. > From user perspective, adding rule is definitely simpler than rewrite query. And this kind of thing can only work for power users who knows how to check query plans and rewrite queries as well. What I meant is that currently in order to apply the rule, user needs to provide a query hint. From my own experience, knowing how to apply the hint is harder than rewriting the query. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org