Constant reduction at Rex level

7 views
Skip to first unread message

Vladimir Sitnikov

unread,
Apr 28, 2014, 4:04:58 AM4/28/14
to opti...@googlegroups.com
Hi,

Does anyone know why optiq does not perform constant reduction at rex level?

I noticed if (false) code in OptiqPrepareImpl:

    // Change the below to enable constant-reduction.
    if (false) {
      planner.addRule(ReduceExpressionsRule.PROJECT_INSTANCE);
      planner.addRule(ReduceExpressionsRule.FILTER_INSTANCE);
      planner.addRule(ReduceExpressionsRule.CALC_INSTANCE);
      planner.addRule(ReduceExpressionsRule.JOIN_INSTANCE);
      planner.addRule(ReduceValuesRule.FILTER_INSTANCE);
      planner.addRule(ReduceValuesRule.PROJECT_FILTER_INSTANCE);
      planner.addRule(ReduceValuesRule.PROJECT_INSTANCE);
    }

It looks like those rules might help optimizing where 1=2 to empty relation eliminating the enumerator(), next(), etc.
From my non-optiq experience, those kind of conditions often arise from "generic queries".

Vladimir
Reply all
Reply to author
Forward
0 new messages