HyperLogLog
in developCo-De with 0 comment

HyperLogLog

in developCo-De with 0 comment

大规模统计/计数 + 小空间占用 + 小概率偏差

统计网站DAU

使用bitmap

使用HyperLogLog

HyperLogLog

HyperLogLog is a data structure that estimates the cardinality of a set. As a probabilistic data structure, HyperLogLog trades perfect accuracy for efficient space utilization. The Redis HyperLogLog implementation uses up to 12 KB and provides a standard error of 0.81%.

Redis PFADD

> PFADD members 123
(integer) 1
> PFADD members 500
(integer) 1
> PFADD members 12
(integer) 1
> PFCOUNT members
(integer) 3

Commands

PFADD adds an item to a HyperLogLog.
PFCOUNT returns an estimate of the number of items in the set.
PFMERGE combines two or more HyperLogLogs into one.
Comments are closed.