[
https://issues.apache.org/jira/browse/CALCITE-4375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17225788#comment-17225788
]
Jiatao Tao edited comment on CALCITE-4375 at 11/4/20, 2:51 AM:
---------------------------------------------------------------
Thanks, [~julianhyde]
I test the RexUtil.toCnf, seems there's room for simplification
case:
before cnf: (a=b && c=7) || (a=b && d=8)
after cnf(with RexSimplfy): (a=b) && (a=b || d=8) && (a=b || c=7) && (c=7 ||
d=8)
expect: (a=b) && (c=7 || d=8)
test code in:
[https://github.com/Aaaaaaron/calcite/tree/cnf]
was (Author: aron.tao):
Thanks, [~julianhyde]
I test the RexUtil.toCnf, seems there's room for simplification
case:
before cnf: (a=b && c=7) || (a=b && d=8)
after cnf(with RexSimplfy): (a=b) && (a=b || d=8) && (a=b || c=7) && (c=7 ||
d=8)
test code in:
https://github.com/Aaaaaaron/calcite/tree/cnf
> Merge join condition that has "OR" as much as possible
> ------------------------------------------------------
>
> Key: CALCITE-4375
> URL: https://issues.apache.org/jira/browse/CALCITE-4375
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Jiatao Tao
> Assignee: Jiatao Tao
> Priority: Major
>
> SQL:
> SELECT * FROM emps,depts
> WHERE
> (emps.name = depts.name AND empno=1)
> OR
> (emps.name = depts.name AND empno=2)
>
> And the join after optimizer is:
> EnumerableNestedLoopJoin(condition=[OR(AND(=($1, $11), =($0, 1)), AND(=($1,
> $11), =($0, 2)))], joinType=[inner])
>
> In fact ($1, $11) can be extracted, and the join can be:
> HashJoin(condition=[AND(=($1, $11), OR(=($0, 1), =($0, 2)))],
> joinType=[inner])
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)