Scalable Uniques in Postgres - HyperLogLog
summary
Shows how the postgresql-hll extension implements HyperLogLog inside Postgres to count uniques, claiming a 280 bytes sketch can estimate tens of billions of distinct values with a few percent error. Describes tuning knobs (log2 m and bits-per-register), automatic switch between explicit and sparse representations, how to insert via functions, and that it was built and used in ad-reporting work with practical accuracy and small storage, though the original product ceased after acquisition.
AI-written summary · about
chapters (6)
- 0:00Introduction to the problem
- 1:32Approximate counting
- 3:24Implementation details
- 5:49Performance and tuning
- 8:26Efficiency and use cases
- 10:44Q&A and system capabilities








