Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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
- duplicates
-
DRILL-3754 Remove redundancy in run-time generated code for common column references.
- Resolved
- relates to
-
CALCITE-481 Add "Spool" operator, to allow re-use of relational expressions
- Closed