[ 
https://issues.apache.org/jira/browse/DRILL-3912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dechang Gu closed DRILL-3912.
-----------------------------

Tested and Verified:  
For the following query: 

select * from comscore_512MB where 
l_orderkey in (1,2,3,4,5,6,7,8,9,10)  or
l_partkey in (20,30,40,55,60,70,80,90,100,101) or
l_suppkey in (11,21,32,44,55,66,77,88,99,111) or
l_linenumber in (12,22,32,42,52,62,72,82,92,102) or
l_quantity in (200,300,400,500,600,700,800,900,1000) or
l_extenededprice in (1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5) or
l_discount in (1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1) or
l_tax in (10,15,20,25,30,35,40,45,50,55) or
l_returnflag in ('r','b','y','d','a','c','p','x') 
limit 100
;

query time reduced by 25% (12s vs 16s), comparing 1.4.0 (gitId 32b871b) to
the one before the commit (gitid bb69f22  mapr-drill 1.3.0 branch).

LGTM.

> Common subexpression elimination in code generation
> ---------------------------------------------------
>
>                 Key: DRILL-3912
>                 URL: https://issues.apache.org/jira/browse/DRILL-3912
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Steven Phillips
>            Assignee: Jinfeng Ni
>             Fix For: 1.3.0
>
>
> 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)

Reply via email to