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

Common subexpression elimination in code generation

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: