Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.37.0
-
None
Description
For SQL:
select * from tbl_a join tbl_b on tbl_a.id = tbl_b.id where (tbl_a.x > 100 and tbl_b.y < 10) or (tbl_a.x > 100 and tbl_b.z > 20)
we can rewrite it to
select * from tbl_a join tbl_b on tbl_a.id = tbl_b.id where tbl_a.x > 100 and (tbl_b.y < 10 or tbl_b.z > 20)
And in this way tbl_a.x > 100 can be pushed down and it is likely that this will help reduce the amount of data involved in the join.
Attachments
Attachments
Issue Links
- is related to
-
CALCITE-399 Factorize common AND factors out of OR predicates
- Closed
-
CALCITE-394 Add RexUtil.toCnf, to convert expressions to conjunctive normal form (CNF)
- Closed
- links to