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

chenglei updated PHOENIX-5451:
------------------------------
    Description: 
Phoenix is already doing column prune for single flat table query, but for 
subselect in subquery or join, column pruning is not implemented.

Consider following join sql :
{code:java}
 select  a.aid,b.bid from (select aid,age from table1 where age >=11 and 
age<=33 order by age limit 3) a inner join 
 (select bid,code from table2 order by code limit 1) b on a.aid=b.bid 
 {code}

for LHS, table1.age is not referenced by outer join, and for RHS, table2.code 
is also not referenced by outer join,  table1.age and table2.code could both be 
pruned when execute query for LHS and RHS, but now Phoenix does not prune them.

Another example is subsquery sql:
{code:java}
{code}


  was:Phoenix is already doing column prune for single flat table query, but 
for subselect in subquery or join, column pruning is not implemented.


> Column pruning for Subselect
> ----------------------------
>
>                 Key: PHOENIX-5451
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5451
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.14.2
>            Reporter: chenglei
>            Priority: Major
>             Fix For: 4.15.0, 5.1.0
>
>
> Phoenix is already doing column prune for single flat table query, but for 
> subselect in subquery or join, column pruning is not implemented.
> Consider following join sql :
> {code:java}
>  select  a.aid,b.bid from (select aid,age from table1 where age >=11 and 
> age<=33 order by age limit 3) a inner join 
>  (select bid,code from table2 order by code limit 1) b on a.aid=b.bid 
>  {code}
> for LHS, table1.age is not referenced by outer join, and for RHS, table2.code 
> is also not referenced by outer join,  table1.age and table2.code could both 
> be pruned when execute query for LHS and RHS, but now Phoenix does not prune 
> them.
> Another example is subsquery sql:
> {code:java}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to