Back to results for “Set”
Redis › HyperLogLog in Redis

What are the limitations of HyperLogLog that make it unsuitable for certain use cases, even though it is excellent for approximate unique counting?

Advanced

Answer

HyperLogLog can only give you the approximate count of unique items and cannot tell you what those specific items actually are, cannot remove a previously added item from the count, and its small error margin makes it unsuitable for situations requiring an exact count, such as billing calculations based on precise usage numbers.
-- HyperLogLog cannot list the actual unique items,
-- only estimate how many there are
PFCOUNT unique_visitors -- returns a count, not the actual visitor list
Real-world example A billing system that needs to charge customers based on an exact count of unique API calls avoids using HyperLogLog for this specific calculation, instead using an exact counting method since even a small error could result in an incorrect charge.

Common follow-ups: What exact counting alternatives exist for situations where HyperLogLog's approximation is not acceptable?;Can you ever retrieve the actual list of items that were added to a HyperLogLog?