Skip to main content

Module aggregate_order

Module aggregate_order 

Source
Expand description

Records the SELECT-list interleaving of GROUP BY keys and aggregate expressions so the output-schema builder emits aggregate result columns in the user’s SELECT order rather than a hardcoded group-keys-first order.

Functions§

compute_output_order
Walk projection in output order and classify each item as a GROUP BY key slot or an aggregate slot, producing the interleaving that output_schema replays to emit columns in SELECT-list order.
compute_output_order_by_item
The output slots each projection item produces, one entry per item in SELECT-list order. An item that is neither a group key nor an aggregate (a star, or a bare non-key expression) produces an empty entry.