[
https://issues.apache.org/jira/browse/FLINK-41523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bonnie Varghese updated FLINK-41523:
------------------------------------
Description:
FlinkLogicalJoin estimates the CPU cost of SEMI and ANTI joins as L + R
This is fine when the join has equi condition. For non equi conditions, the
physical join chosen is a NestedLoopJoin (NLJ) which costs O(m*n)
However, due to the L+R cost, sometimes the a semi/anti join without an equi
condition can look cheap and the planner may move it below a regular join.
If we report the CPU cost as L*R in the logical plan then we can prevent such
join placement issues.
Observed while testing tpc-h q16 with row and col stats.
was:
FlinkLogicalJoin estimates the CPU cost of SEMI and ANTI joins as L + R
This is fine when the join has equi condition. For non equi conditions, the
physical join chosen is a NestedLoopJoin (NLJ) which costs O(m*n)
However, due to the L+R cost, sometimes the a semi/anti join without an equi
condition can look cheap and the planner may move it below a regular join.
If we report the CPU cost L*R in the logical plan then we can prevent such join
placement issues.
Observed while testing tpc-h q16 with row and col stats.
> Logical cost of semi/anti joins without equi-join keys underestimates CPU cost
> ------------------------------------------------------------------------------
>
> Key: FLINK-41523
> URL: https://issues.apache.org/jira/browse/FLINK-41523
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 2.5.0
> Reporter: Bonnie Varghese
> Assignee: Bonnie Varghese
> Priority: Major
> Fix For: 2.5.0
>
>
> FlinkLogicalJoin estimates the CPU cost of SEMI and ANTI joins as L + R
> This is fine when the join has equi condition. For non equi conditions, the
> physical join chosen is a NestedLoopJoin (NLJ) which costs O(m*n)
> However, due to the L+R cost, sometimes the a semi/anti join without an equi
> condition can look cheap and the planner may move it below a regular join.
> If we report the CPU cost as L*R in the logical plan then we can prevent such
> join placement issues.
> Observed while testing tpc-h q16 with row and col stats.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)