COUNT rows is bucket size.

highlighted = computed this step

Count rows in each group

COUNT rows is the size of each bucket.

count=bucket size\text{count}=\text{bucket size}

Add row counts

The output has 3 grouped rows with a count column.

output groups=3\text{output groups}=3

Grouping examples are tiny finite table transforms; SQL dialects, NULLs, AVG/rounding, planner behavior, indexes, performance, and product behavior are out of scope.

Count rows in each group: base rowssourceRowidkindqty01book212game123book334game445tool1 group by columnscolumnkind aggregate specsopcolumnascount_rowsrowsn group bucketskeysourceRowsrowCount[book][0, 2]2[game][1, 3]2[tool][4]1 aggregate rowskeyn[book]2[game]2[tool]1 having keep/dropkeystatusreason[book]keepno_having[game]keepno_having[tool]keepno_having output rowskeyn[book]2[game]2[tool]1 group factsfactvaluerowCount5groupByColumnCount1groupCount3aggregateCount1outputGroupCount3havingnonehiddenGroupsno

Match count to bucket

The aggregate rows line up with the bucket row counts.

n from rowCount\text{n from rowCount}

Summary

COUNT is integer-only here because it counts exact rows.

integer count\text{integer count}