Redis HyperLogLog Calculator

See what a HyperLogLog costs against an exact set at your cardinality, and what the approximation actually means in absolute terms.

Paste below, or drop a file anywhere on this panel

Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.

The answer appears here

Paste on the left and press Calculate. Nothing leaves this tab.

Examples

Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.

Ten million uniques

Where the saving against a set is enormous

cardinality: 10000000

A small cardinality

Where a set is exact and barely larger, so the approximation buys nothing

cardinality: 500

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Reporting a PFCOUNT as exact

    It is an estimate with a 0.81% standard error. At ten million that is roughly plus or minus eighty thousand.

    Instead:Never use it for billing, reconciliation or anything audited.

  2. Using it below a few thousand distinct values

    A set is exact and costs about the same at that scale.

    Instead:Switch to a set. The saving only appears at large cardinalities.

  3. Forgetting PFMERGE is the real feature

    Daily HyperLogLogs merge into weekly and monthly with no extra loss, which storing the members cannot do cheaply.

    Instead:Store one per period and merge on read.