[
https://issues.apache.org/jira/browse/CALCITE-6891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zhen Chen updated CALCITE-6891:
-------------------------------
Attachment: image-2025-03-16-09-38-41-654.png
> Implement IntersectReorderRule
> ------------------------------
>
> Key: CALCITE-6891
> URL: https://issues.apache.org/jira/browse/CALCITE-6891
> Project: Calcite
> Issue Type: Improvement
> Reporter: Zhen Chen
> Assignee: Zhen Chen
> Priority: Major
> Attachments: image-2025-03-16-09-37-47-916.png,
> image-2025-03-16-09-38-41-654.png
>
>
> Do we need this rule?
> from:
>
> {code:java}
> LogicalIntersect(all=[false])
> LogicalProject(DEPTNO=[$7])
> LogicalFilter(condition=[>($7, 10)])
> LogicalTableScan(table=[[CATALOG, SALES, EMP(big)]])
> LogicalProject(DEPTNO=[$0])
> LogicalFilter(condition=[>($0, 5)])
> LogicalTableScan(table=[[CATALOG, SALES, DEPT(small)]]){code}
> to
>
>
> {code:java}
> LogicalIntersect(all=[false])
> LogicalProject(DEPTNO=[$0])
> LogicalFilter(condition=[>($0, 5)])
> LogicalTableScan(table=[[CATALOG, SALES, DEPT(small)]])
> LogicalProject(DEPTNO=[$7])
> LogicalFilter(condition=[>($7, 10)])
> LogicalTableScan(table=[[CATALOG, SALES, EMP(big)]]) {code}
> This rule put smaller inputs first. This helps reduce the size of
> intermediate results.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)