You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/10/07 23:52:26 UTC

[jira] [Commented] (DRILL-3912) Common subexpression elimination

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

Julian Hyde commented on DRILL-3912:
------------------------------------

Take a look at Calcite's RexProgram. It internally removes sub-expressions, topologically sorting them so that simplest expressions occur first. Also, if you have combined project and filter into one operation, it evaluates expressions used in the filter first.

> Common subexpression elimination
> --------------------------------
>
>                 Key: DRILL-3912
>                 URL: https://issues.apache.org/jira/browse/DRILL-3912
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Steven Phillips
>            Assignee: Steven Phillips
>
> Drill currently will evaluate the full expression tree, even if there are redundant subtrees. Many of these redundant evaluations can be eliminated by reusing the results from previously evaluated expression trees.
> For example,
> {code}
> select a + 1, (a + 1)* (a - 1) from t
> {code}
> Will compute the entire (a + 1) expression twice. With CSE, it will only be evaluated once.
> The benefit will be reducing the work done when evaluating expressions, as well as reducing the amount of code that is generated, which could also lead to better JIT optimization.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)