Status: In Progress
Affects Version/s: None
Fix Version/s: None
Component/s: Query Processor
Consider a query like:
select * from
select key, 1 as value, count(1) from src group by key
select 1 as key, value, count(1) from src group by value
select key, value, count(1) from src group by key, value
src is scanned multiple times currently (one per sub-query).
This should be treated like a multi-table insert by the optimizer.