asdfgh19 created CALCITE-5991:
---------------------------------

             Summary: Reduce the number of tasks related to AbstractConverter 
in TopDownRuleDriver
                 Key: CALCITE-5991
                 URL: https://issues.apache.org/jira/browse/CALCITE-5991
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: asdfgh19
            Assignee: asdfgh19
         Attachments: image-2023-09-10-15-44-42-472.png

When executing the ensureRootConverters method, we add AbstractConverter to the 
root Relset.

In the OptimizeGroup task.

When the TraitSet of AbstractConverter does not satisfy group, we try 
passThrough. Since AbstractConverter is not a PhysicalNode instance, 
passThrough returns null, and then we try Apply ConverterRule for this 
AbstractConverter. This process can be simplified.

When the TraitSet of AbstractConverter satisfies group, we perform three tasks: 
DeriveTrait, CheckInput, and OptimizeGroup. DeriveTrait can be simplified to 
ApplyRules because derive is invalid because AbstractConverter is not an 
instance of PhysicalNode.

And I think CheckInput can be removed in this scenario, because when a Relset 
merge occurs, when the root Relset merges to the other Relset, the 
OptimizeGroup will be re-executed from the root Relset. At this time, the 
equivalent Relsubset of the original child node of the AbstractConverter caused 
by the Relset merge OptimizeGroup will also be executed, so there is no need to 
use CheckInput to trigger the OptimizeGroup task of AbstractConverter's new 
input Relsubset.

The following is the total number of tasks performed by each test case in 
TopDownOptTest before and after optimization.
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to