[
https://issues.apache.org/jira/browse/CALCITE-3643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005170#comment-17005170
]
Haisheng Yuan commented on CALCITE-3643:
----------------------------------------
In some cases, commutativity can still help. e.g. select * from foo t1, foo t2
where t1.a=t2.b.
If there is index on column a, nestedloopjoin with t2 as outer may be better.
If the value of column a is evenly distributed, but column b is highly skewed,
building hash table on a is better.
But IMHO, they should be different inputs fundamentally, which is another topic.
> Prevent matching JoinCommuteRule when both inputs are the same
> --------------------------------------------------------------
>
> Key: CALCITE-3643
> URL: https://issues.apache.org/jira/browse/CALCITE-3643
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Vladimir Sitnikov
> Assignee: Vladimir Sitnikov
> Priority: Major
> Fix For: 1.22.0
>
>
> The conditions like =($0, $1) and =($1, $1) are equivalent, however adding
> that permutation increases search space and it gains nothing.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)