Is your feature request related to a problem or challenge?
Part of #22710
Follow up to #23309
Describe the solution you'd like
For ordered aggregation, we can likely simplify the implementation in a similar way to #23309.
The ordered aggregation case can be split into two variants:
- Fully ordered input: the input is ordered by
(a, b), and the query groups by (a, b)
- Partially ordered input: the input is ordered by
a, and the query groups by (a, b)
For the partially ordered variant, we should still use regular hash aggregation, with the early-emit optimization. For the fully ordered variant, there may be a deeper optimization that avoids the hash table entirely.
This refactor is probably easier after we first add the fast path for the fully ordered case. 🤔
Describe alternatives you've considered
No response
Additional context
No response
Is your feature request related to a problem or challenge?
Part of #22710
Follow up to #23309
Describe the solution you'd like
For ordered aggregation, we can likely simplify the implementation in a similar way to #23309.
The ordered aggregation case can be split into two variants:
(a, b), and the query groups by(a, b)a, and the query groups by(a, b)For the partially ordered variant, we should still use regular hash aggregation, with the early-emit optimization. For the fully ordered variant, there may be a deeper optimization that avoids the hash table entirely.
This refactor is probably easier after we first add the fast path for the fully ordered case. 🤔
Describe alternatives you've considered
No response
Additional context
No response