UltraLogLog:一种用于近似基数统计的实用且更节省空间的 HyperLogLog 替代方案
UltraLogLog: A Practical and More Space-Efficient Alternative to HyperLogLog for Approximate Distinct Counting
AI总结:
UltraLogLog 在保持 HyperLogLog 实用特性的同时,通过改进数据结构和估计方法将空间占用降低 17% 至 28%,并已作为开源 Hash4j 库的一部分发布。
摘要:
自发明以来,HyperLogLog 已成为近似基数统计的标准算法。由于其空间效率高且适合分布式系统,它被广泛使用,并在众多数据库中实现。本文提出了 UltraLogLog,它具有与 HyperLogLog 相同的实用特性:满足交换律、幂等性、可合并性,并具有快速的、有保证的常数时间插入操作。同时,它编码相同数量的基数统计信息所需的空间减少了 28%,这些信息可以使用最大似然法提取。此外,本文还提出了一种更简单、更快速的估计器,它仍能实现 24% 的空间缩减,但估计速度与 HyperLogLog 相当。在可以使用鞅估计的非分布式环境中,UltraLogLog 能够将空间减少 17%。此外,其更小的熵和 8 位寄存器在使用标准压缩算法时能带来更好的压缩效果。所有这些都得到了实验结果的验证,实验结果与理论分析完全一致,理论分析还指出了构建更节省空间的数据结构的潜力。UltraLogLog 的生产就绪 Java 实现已作为开源 Hash4j 库的一部分发布。
英文摘要:
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 UltraLogLog, 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。