http://content.research.neustar.biz/blog/hll.html

案例

  1. # 往hyperloglog对象添加元素
  2. 127.0.0.1:6379> PFADD HLL1 Joe Mary King
  3. (integer) 1
  4. # 计算唯一元素个数
  5. 127.0.0.1:6379> PFCOUNT HLL1
  6. (integer) 3
  7. # 添加重复元素
  8. 127.0.0.1:6379> PFADD HLL1 King
  9. (integer) 0
  10. 127.0.0.1:6379> PFCOUNT HLL1
  11. (integer) 3
  12. 127.0.0.1:6379> PFADD HLL2 Mark Yur Jack King Joe
  13. (integer) 1
  14. 127.0.0.1:6379> PFMERGE HLL HLL1 HLL2
  15. OK
  16. 127.0.0.1:6379> PFCOUNT HLL
  17. (integer) 6