-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Describe the bug
The intent of SingleDistinctToGroupBy is to rewrite queries that have multiple references to the same distinct expression, such as SELECT F1(DISTINCT s),F2(DISTINCT s) to avoid evaluating the distinct multiple times.
However, it is currently applied even if there is only a single distinct value, adding unnecessary complexity to simple queries,
To Reproduce
Only apply the rule when it is needed.
Expected behavior
Additional context
benchmark q16 is a good example of where it is applied but not needed