Grouping starts from visible input rows, not from hidden summary labels.
rows first
Show the rows
The table has 5 rows and will form 3 groups by kind.
rows=5
Grouping examples are tiny finite table transforms; SQL dialects, NULLs, AVG/rounding, planner behavior, indexes, performance, and product behavior are out of scope.
Read sourceRow
Each input row keeps a sourceRow so the later buckets can point back to it.
source rows are visible
Summary
Every displayed count later in the book is recomputed from these rows.