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

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

I missed it first time around: you are dealing with the subtle (and somewhat 
infrequent) case of a cycle of length 1. It's worth calling out in the comment.

Computing child sets, and whether set is parent of set2, is a little expensive, 
so I would cache in variables.

I stand by my previous remarks that when neither is parent of the other, it is 
worth choosing by popularity first, size second, and lastly age.

> 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