UltraLogLog: A Practical and More Space-Efficient Alternative to HyperLogLog for Approximate Distinct Counting
Abstract
Since its invention HyperLogLog has become the standard algorithm for approximate distinct counting. Due to its space efficiency and suitability for distributed systems, it is widely used and also implemented in numerous databases. This work presents UltraLog-Log, which shares the same practical properties as HyperLogLog. It is commutative, idempotent, mergeable, and has a fast guaranteed constant-time insert operation. At the same time, it requires 28% less space to encode the same amount of distinct count information, which can be extracted using the maximum likelihood method. Alternatively, a simpler and faster estimator is proposed, which still achieves a space reduction of 24%, but at an estimation speed comparable to that of HyperLogLog. In a non-distributed setting where martingale estimation can be used, UltraLogLog is able to reduce space by 17%. Moreover, its smaller entropy and its 8-bit registers lead to better compaction when using standard compression algorithms. All this is verified by experimental results that are in perfect agreement with the theoretical analysis which also outlines potential for even more space-efficient data structures. A production-ready Java implementation of UltraLogLog has been released as part of the open-source Hash4j library.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- From Single to Multiple Attributes: Experimental Insights on Sampling-Based Distinct Combination Estimation in Group-by Queries cites Information theoretic limits of cardinality estimation: Fisher meets Shannon
- From Single to Multiple Attributes: Experimental Insights on Sampling-Based Distinct Combination Estimation in Group-by Queries cites AdaNDV: Adaptive Number of Distinct Value Estimation via Learning to Select and Fuse Estimators
- Sublime: Sublinear Error & Space for Unbounded Skewed Streams cites HyperLogLogLog: Cardinality Estimation With One Log More
- PLM4NDV: Minimizing Data Access for Number of Distinct Values Estimation with Pre-trained Language Models cites AdaNDV: Adaptive Number of Distinct Value Estimation via Learning to Select and Fuse Estimators
Cited by top-tier papers4
- AdaNDV: Adaptive Number of Distinct Value Estimation via Learning to Select and Fuse EstimatorsXianghong Xu, Tieying Zhang, Xiao He, Haoyang Li et al.VLDB 2025 · 3 citations
- PLM4NDV: Minimizing Data Access for Number of Distinct Values Estimation with Pre-trained Language ModelsXianghong Xu, Xiao He, Tieying Zhang, Lei Zhang et al.SIGMOD 2025 · 1 citation
- From Single to Multiple Attributes: Experimental Insights on Sampling-Based Distinct Combination Estimation in Group-by QueriesYujie Zhang, Xiaochun Yang, Bin Wang, Yuan SuiICDE 2026
- Sublime: Sublinear Error & Space for Unbounded Skewed StreamsNavid Eslami, Ioana O. Bercea, Rasmus Pagh, Niv DayanSIGMOD 2026
Builds on2
Related papers
- SetSketch: Filling the Gap between MinHash and HyperLogLogOtmar ErtlVLDB 2021 · 17 citations
- 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
- Memory-Efficient Key/Foreign-Key Join Size Estimation via Multiplicity and Intersection SizeMagnus Müller, Daniel Flachs, Guido MoerkotteICDE 2021 · 4 citations
- Learning to be a Statistician: Learned Estimator for Number of Distinct ValuesRenzhi Wu, Bolin Ding, Xu Chu, Zhewei Wei et al.VLDB 2022 · 16 citations
- Locally Uniform HashingIoana O. Bercea, Lorenzo Beretta, Jonas Klausen, Jakob Bæk Tejs Houen et al.FOCS 2023 · 4 citations
