ASA SQL User's Guide
Query Optimization and Execution
Query execution algorithms
Grouping
The ordered group by reads an input that is ordered by the grouping columns. As each row is read, it is compared to the previous row. If the grouping columns match, then the current group is updated; otherwise, the current group is output and a new group is started.