[ 
https://issues.apache.org/jira/browse/FLINK-41636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated FLINK-41636:
-----------------------------------
    Labels: pull-request-available  (was: )

> Remove duplicates from the right input of INTERSECT/EXCEPT in batch mode
> ------------------------------------------------------------------------
>
>                 Key: FLINK-41636
>                 URL: https://issues.apache.org/jira/browse/FLINK-41636
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>    Affects Versions: 2.5.0
>            Reporter: Bonnie Varghese
>            Assignee: Bonnie Varghese
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.5.0
>
>
> In batch mode, a distinct INTERSECT/EXCEPT is rewritten to a SEMI/ANTI join 
> on all columns. The right input goes into the join unchanged, but the join 
> only checks whether a match exists, so duplicates on the right are wasted 
> work. They also inflate the right input's row count, which can cause the 
> planner can pick the wrong build side.
> Observed while testing TPC-DS SF100 q14a/q14b
> The right input of the INTERSECT repeats a few thousand item keys tens of 
> millions of times. The planner builds the hash table on the small left input 
> and probes it with every right row.
> Adding a distinct helps improve the query runtime by 6-7x



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to