You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we eliminate the aggregation after it's built.
So consider the following case: select max(a) from t group by b
The b is a unique & not null column. So the aggregation can be eliminated. But we will allocate a new column for max(a)(such as col#x, for example). Then we get a projection proj(a->col#x(which is max(a)) This projection cannot be eliminated in the whole optimization phase because we'll need to re-construct the output columns for the whole parent plan operators of the projection to replace the column col#x to column a.
This breaks the rule that an optimization rule should only affect a small part of the plan tree.
This projection might block other optimizations, such as that this projection cuts a join tree into two parts, so the join reorder cannot be performed as much as we can.
We need to eliminate the aggregation as early as possible to avoid such cases.
The text was updated successfully, but these errors were encountered:
Enhancement
Currently, we eliminate the aggregation after it's built.
So consider the following case:
select max(a) from t group by b
The
b
is a unique & not null column. So the aggregation can be eliminated. But we will allocate a new column formax(a)
(such as col#x, for example). Then we get a projectionproj(a->col#x(which is max(a))
This projection cannot be eliminated in the whole optimization phase because we'll need to re-construct the output columns for the whole parent plan operators of the projection to replace the columncol#x
to columna
.This breaks the rule that an optimization rule should only affect a small part of the plan tree.
This projection might block other optimizations, such as that this projection cuts a join tree into two parts, so the join reorder cannot be performed as much as we can.
We need to eliminate the aggregation as early as possible to avoid such cases.
The text was updated successfully, but these errors were encountered: