[jira] [Created] (CALCITE-2452) RexSimplify: avoid multiple similar optimization passes over the same nodes
Vladimir Sitnikov created CALCITE-2452:
Summary: RexSimplify: avoid multiple similar optimization passes over the same nodes
Issue Type: Sub-task
Reporter: Vladimir Sitnikov
Assignee: Julian Hyde
simplifyAndTerms(List<RexNode> terms) has two loops and it calls simplify on each expression twice.
simplifyAnd(RexCall e) calls simplifyList (that walks all the tree down), then simplifyAnd2ForUnknownAsFalse calls simplify_ again.
It looks like just one pass should be sufficient for most of the cases, and the logic should probably be adjusted as follows:
// e.g. simplify the node with assumption that all the arguments were simplified, etc, avoid complicated checks
node = simplifyTrivialCases(node);
// this walks over the tree, simplifies operands first then simplifies the call itself
node = simplifyArgumentsThenSimplifyNode(node);
Method naming should clearly indicate that the method is heavy, so it would not accidentally be used.
This message was sent by Atlassian JIRA