[ 
https://issues.apache.org/jira/browse/CALCITE-4514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17291973#comment-17291973
 ] 

Julian Hyde commented on CALCITE-4514:
--------------------------------------

[~botong], I agree that we would benefit from making a conscious choice.

However, my intuition is that size (number of RelNode members) is a more 
important consideration than age. So we should merge into the larger subset 
(discarding the smaller subset). In the event of a tie, choose the older subset 
(which will make the process deterministic).

Clearly, the size and age rules will make the same decision most of the time.

Another consideration (let's call it "popularity") is the number of inbound 
references. That may be even more important.


> Prefer merge new relset into old relset when they are parent set of each other
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-4514
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4514
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Botong Huang
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When merging two relsets, we have two preferences: 
> 1. Merge parent relset into child relset
> 2. Merge newer relset into older relset
> Currently, when the two relsets are parent set of each other, we randomly 
> pick a merge order without checking the second condition above. For 
> performance reasons, we should, to avoid unnecessary churn. 



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

Reply via email to