Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用一个非常简单的 redis HLL 实现
PFADD 添加元素和 PFCOUNT (带有 PFMERGE 的东西)来获取计数
有没有办法通过增加分配的内存等来调整 redis HLL 的效率
你不能。hyperloglog 的大小是硬编码的,您无法通过配置或编译时选项更改它。如果您确实需要更改它,则必须修改源代码并自行构建。
// hyperloglog.c #define HLL_P 14 /* The greater is P, the smaller the error. */
此外,P 越大,它消耗的内存就越多。