Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3912

Common subexpression elimination in code generation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • None
    • None

    Description

      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,

      select a + 1, (a + 1)* (a - 1) from t
      

      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.

      Attachments

        Issue Links

          Activity

            People

              jni Jinfeng Ni
              sphillips Steven Phillips
              Dechang Gu Dechang Gu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: