[ 
https://issues.apache.org/jira/browse/OPTIQ-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14044408#comment-14044408
 ] 

Vladimir Sitnikov commented on OPTIQ-312:
-----------------------------------------

It looks like there's a simple solution: ensure the first "CalcRelSplitter 
level" is CalcRelType, that triggers projection optimization and results in the 
desired plan without new rules.
See https://github.com/julianhyde/optiq/pull/307



> Need PushProjectThroughWindowRel
> --------------------------------
>
>                 Key: OPTIQ-312
>                 URL: https://issues.apache.org/jira/browse/OPTIQ-312
>             Project: optiq
>          Issue Type: Improvement
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>            Priority: Minor
>
> Currently optiq does not push projects through {{WindowRel}}, thus it feeds 
> excessive data to {{WindowRel}}.
> {code:sql}
> select *
>   from (
>     select "empid", "deptno", count(*) over (partition by "deptno") c
>       from "hr"."emps"
>  )
>  where "deptno"=10 and "empid"=100{code}
> Optiq should recognize it is required to track just fields {{empid}} and 
> {{deptno}}.
> However the java code is as follows (note that empid, name, salary, and 
> commission are projected):
> {code:java}
> /*  47 */       _list.add(new Object[] {
> /*  48 */         row.empid,
> /*  49 */         row.deptno,
> /*  50 */         row.name,
> /*  51 */         row.salary,
> /*  52 */         row.commission,
> /*  53 */         COUNTa0w0});
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to