[jira] [Comment Edited] (CALCITE-2111) Make HepPlanner more efficient by applying rules depth-first

2018-01-04 Thread LeoWangLZ (JIRA)

[ 
https://issues.apache.org/jira/browse/CALCITE-2111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16312316#comment-16312316
 ] 

LeoWangLZ edited comment on CALCITE-2111 at 1/5/18 1:21 AM:


[~julianhyde] ok. Thanks


was (Author: perid007):
[~julianhyde] I got it, Thanks

> Make HepPlanner more efficient by applying rules depth-first
> 
>
> Key: CALCITE-2111
> URL: https://issues.apache.org/jira/browse/CALCITE-2111
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.15.0
>Reporter: LeoWangLZ
>Assignee: Julian Hyde
> Fix For: 1.16.0
>
>
> HepPlanner#applyRules will fully restart after transformation.
> if the rule for the inner relNode happens transformation, then the previous 
> all relNode will be apply for all rules again. and the accumulated rule apply 
> will be exploded as rule apply.
> like query that it contains hundreds of  union all
> {code:java}
> select * from (
>   select ENAME, 50011895 as cat_id, '1' as cat_name, 1 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,1 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50011895 union all
>   select ENAME, 50013023 as cat_id, '2' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013023 union all
>   select ENAME, 50013032 as cat_id, '3' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013032 union all
>   select ENAME, 50013024 as cat_id, '4' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013024 union all
>   select ENAME, 50004204 as cat_id, '5' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50004204 union all
>   select ENAME, 50013043 as cat_id, '6' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013043 union all
>   select ENAME, 290903 as cat_id, '7' as cat_name, 1 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,1 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 290903 union all
>   select ENAME, 50008261 as cat_id, '8' as cat_name, 1 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,1 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50008261 union all
>   select ENAME, 124478013 as cat_id, '9' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 1 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 124478013 union all
> ...
> )a;
> {code} 
> For rules ReduceExpressionsRule.FILTER_INSTANCE and 
> ReduceExpressionsRule.PROJECT_INSTANCE,  it apply 1W+ rules.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (CALCITE-2111) Make HepPlanner more efficient by applying rules depth-first

2018-01-04 Thread LeoWangLZ (JIRA)

[ 
https://issues.apache.org/jira/browse/CALCITE-2111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16312316#comment-16312316
 ] 

LeoWangLZ edited comment on CALCITE-2111 at 1/5/18 1:21 AM:


[~julianhyde] I got it, Thanks


was (Author: perid007):
[~julianhyde] I got, Thanks

> Make HepPlanner more efficient by applying rules depth-first
> 
>
> Key: CALCITE-2111
> URL: https://issues.apache.org/jira/browse/CALCITE-2111
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.15.0
>Reporter: LeoWangLZ
>Assignee: Julian Hyde
> Fix For: 1.16.0
>
>
> HepPlanner#applyRules will fully restart after transformation.
> if the rule for the inner relNode happens transformation, then the previous 
> all relNode will be apply for all rules again. and the accumulated rule apply 
> will be exploded as rule apply.
> like query that it contains hundreds of  union all
> {code:java}
> select * from (
>   select ENAME, 50011895 as cat_id, '1' as cat_name, 1 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,1 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50011895 union all
>   select ENAME, 50013023 as cat_id, '2' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013023 union all
>   select ENAME, 50013032 as cat_id, '3' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013032 union all
>   select ENAME, 50013024 as cat_id, '4' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013024 union all
>   select ENAME, 50004204 as cat_id, '5' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50004204 union all
>   select ENAME, 50013043 as cat_id, '6' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50013043 union all
>   select ENAME, 290903 as cat_id, '7' as cat_name, 1 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,1 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 290903 union all
>   select ENAME, 50008261 as cat_id, '8' as cat_name, 1 as 
> require_free_postage, 0 as  require_15return, 0 as require_48hour,1 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 50008261 union all
>   select ENAME, 124478013 as cat_id, '9' as cat_name, 0 as 
> require_free_postage, 0 as  require_15return, 1 as require_48hour,0 as  
> require_insurance from emp where EMPNO = 20171216 and MGR = 0 and ENAME = 'Y' 
> and SAL = 124478013 union all
> ...
> )a;
> {code} 
> For rules ReduceExpressionsRule.FILTER_INSTANCE and 
> ReduceExpressionsRule.PROJECT_INSTANCE,  it apply 1W+ rules.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)