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

Ruben Q L updated CALCITE-3829:
-------------------------------
    Fix Version/s: 1.23.0

> MergeJoinEnumerator should not use inputs enumerators until it is really 
> required
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-3829
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3829
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.21.0
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.23.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {{EnumerableDefaults#MergeJoinEnumerator}} provides an {{Enumerator}} that 
> performs a merge join between two sorted inputs. This sort operation can be 
> potentially very expensive, so we should skip it if possible. Right now, 
> merge join inputs' enumerators are created when {{MergeJoinEnumerator}} is 
> constructed; however, there are some cases where we can skip the enumerator 
> creation of one input: if the outer (i.e. left) enumerator returns no 
> results, there is no need to access (and sort) the inner (i.e. right) 
> enumerator. For this reason, we should delay the inner enumerator creation 
> until the moment we are sure it is really required: when the first element of 
> the outer enumerator is fetched. This strategy is already in place in other 
> join algorithms in {{EnumerableDefaults}} (e.g. {{nestedLoopJoinOptimized}}, 
> {{semiEquiJoin}}), and it will be quite easy to apply on 
> {{MergeJoinEnumerator}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to