article
Average stored in a table that adds everything up
A few of my ClickHouse rollups kept an average next to the total, and the summing engine would have added those averages on every merge; now they keep total and count and divide at read time, and the affected rollup keys now include every label they store.
Read more