Skip to main content

Module sql_group

Module sql_group 

Source
Expand description

What a SQL GROUP BY result was grouped from, read from the statement itself, so Enter on a row of the result can show the rows behind it.

Only a plain grouping of the one table qualifies: SELECT keys…, aggregates… FROM df [WHERE …] GROUP BY keys [HAVING …] [ORDER BY …] [LIMIT …], each key selected. Joins, subqueries, CTEs, set operations, window functions, DISTINCT ON, GROUP BY ALL and keys that are not in the select list give no plan, so drill-down stays off rather than guess.

Structs§

GroupPlan
How a grouped statement relates its result to its source rows.
PlanKey
One grouping key: where it sits in the result and how the source computes it.

Enums§

KeySource

Functions§

passed_through
The columns of sql’s result, named in result, that are columns of the table it reads (named in columns) unchanged, renamed or not: each result name with the column’s. Only a plain statement’s select list is read: *, a column, or a column AS a name. Anything else, or a statement that is not plain, gives none.
plan
The plan for sql, run against a table whose columns are columns and giving a result result_width columns wide, or None when the statement is not a grouping whose rows can be traced back reliably.