Description
Phoenix has already could prune column for single flat table query, but for subselect in subquery or join, column pruning is not implemented.
Consider following join sql :
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
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 executing query for LHS and RHS, but now Phoenix does not prune them.
Another example is subquery sql:
SELECT t.eid id, t.bstr b FROM (SELECT entity_id eid, a_string astr, b_string bstr FROM table WHERE a_byte + 1 < 9 limit 2) t ORDER BY b,id
for inner subselect sql, a_string is never used by outer sql, so a_string could be pruned when executing query for inner subselect, but now Phoenix does not prune it.
Some existing test cases could be optimized by this patch.
Attachments
Attachments
Issue Links
- links to