Architecture··10 min read
COUNT(DISTINCT) Does Not Scale. HyperLogLog Does.
Counting a billion distinct items exactly costs about 16 GB. Estimating it to within one percent costs 12 KB. Here is the trade, and the one operation it cannot do.
Read post