Details
-
Improvement
-
Status: In Progress
-
Minor
-
Resolution: Unresolved
-
3.2.1
-
None
-
None
Description
Inner Join with aggregation on one of its child it equivalent to a Semi Join with the aggregation eliminated If the aggregation is just doing grouping and all the grouping columns appears in the join condition.
For example, Inner Join like below
select * from table1 inner join (select key2 from table2 group by key2) subquery on table1.key1 = subquery.key2
can be transformed to a semi join and eliminate the aggregate in the subquery
select * from table1 semi join (select key2 from table2) subquery on table1.key1 = subquery.key2
I think this can be added as a optimize rule to save the unnecessary aggregation in the subquery.
Attachments
Issue Links
- links to