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
projectionin output order and classify each item as a GROUP BY key slot or an aggregate slot, producing the interleaving thatoutput_schemareplays 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.