HyperLogLog Commands
HyperLogLog is a probabilistic data structure used to estimate the cardinality (number of unique elements) of a set, using a small and fixed amount of memory.
- Approximate result: not exact, with a small error rate (typically ~0.81% in Redis-style HLL).
- Use cases: UV counting, unique search queries, deduplication statistics, etc.
Command List
PFADD
Adds elements to a HyperLogLog
PFCOUNT
Returns the estimated cardinality
PFMERGE
Merges multiple HyperLogLogs into one
Notes
- The returned cardinality is an estimate, not an exact count.
- In Redis, HyperLogLog is represented as a string internally. Rudis also reports
TYPEasstringfor compatibility.