HyperLogLogLog: Cardinality Estimation With One Log More
Matti Karppa, Rasmus Pagh
Abstract
We present HyperLogLogLog, a practical compression of the Hy-perLogLog sketch that compresses the sketch from ๐ (๐ log log ๐) bits down to ๐ log 2 log 2 log 2 ๐ + ๐ (๐ + log log ๐) bits for estimating the number of distinct elements ๐ using ๐ registers. The algorithm works as a drop-in replacement that preserves all estimation properties of the HyperLogLog sketch, it is possible to convert back and forth between the compressed and uncompressed representations, and the compressed sketch maintains mergeability in the compressed domain. The compressed sketch can be updated in amortized constant time, assuming ๐ is sufficiently larger than ๐. We provide a C++ implementation of the sketch, and show by experimental evaluation against well-known implementations by Google and Apache that our implementation provides small sketches while maintaining competitive update and merge times. Concretely, we observed approximately a 40% reduction in the sketch size. Furthermore, we obtain as a corollary a theoretical algorithm that compresses the sketch down to ๐ log 2 log 2 log 2 log 2 ๐ + ๐ (๐ log log log ๐/log log ๐ + log log ๐) bits. CCS CONCEPTS โข Information systems โ Data management systems; โข Theory of computation โ Design and analysis of algorithms.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers4
- UltraLogLog: A Practical and More Space-Efficient Alternative to HyperLogLog for Approximate Distinct CountingOtmar ErtlVLDB 2024 ยท 12 citations
- QSketch: An Efficient Sketch for Weighted Cardinality Estimation in StreamsYiyan Qi, Rundong Li, Pinghui Wang, Yufang Sun et al.KDD 2024 ยท 3 citations
- Efficient and Accurate Differentially Private Cardinality Continual ReleasesDongdong Xie, Pinghui Wang, Quanqing Xu, Chuanhui Yang et al.SIGMOD 2025 ยท 1 citation
- Sublime: Sublinear Error & Space for Unbounded Skewed StreamsNavid Eslami, Ioana O. Bercea, Rasmus Pagh, Niv DayanSIGMOD 2026
Related papers
- A Better Cardinality Estimator with Fewer Bits, Constant Update Time, and MergeabilityYang Du, He Huang, Yu-e Sun, Kejian Li et al.INFOCOM 2023 ยท 6 citations
- SetSketch: Filling the Gap between MinHash and HyperLogLogOtmar ErtlVLDB 2021 ยท 17 citations
- Unmasking Vulnerabilities: Cardinality Sketches under Adaptive InputsSara Ahmadian, Edith CohenICML 2024 ยท 7 citations
- Information theoretic limits of cardinality estimation: Fisher meets ShannonSeth Pettie, Dingyu WangSTOC 2021 ยท 12 citations
- Efficient framework for operating on data sketchesJakub LemieszVLDB 2023 ยท 6 citations
