Field note · April 7, 2025
The category that eats the chart
3 values with 92.4% concentrated in one of them, and what that does to every chart downstream.
status on sensor-telemetry has 3 values, and one of them is 92.4% of the data.
ok— 7,394 rows, 92.4%warn— 482 rows, 6.0%fault— 124 rows, 1.6%
The top three take 100.0% between them. With only 3 values there is no tail to worry about, which makes this a genuinely easy column to chart.
select status,
count(*) as rows,
round(100.0 * count(*) / sum(count(*)) over (), 1) as pct,
round(avg(temp_c)::numeric, 2) as avg_temp_c
from sensor_telemetry
group by 1
order by rows desc;The second column is the one that matters. Share of rows tells you what is common; avg_temp_c tells you whether the common thing is the important thing. They disagree more often than not, and a chart that shows only the first is answering the easier question.
Decide what happens to the tail before you plot it. "Other" as an explicit bucket is honest; twelve slivers is not, and neither is silently taking the top eight.