Overview
HyperLogLog is a data structure that maintains an invariant that supports efficient queries, updates, summaries, or indexing. It trades implementation complexity for faster or more compact operations on repeated workloads.
HyperLogLog organizes data around a query, update, ordering, or approximation invariant.
Compact metadata for implementation and discovery.
HyperLogLog is a data structure that maintains an invariant that supports efficient queries, updates, summaries, or indexing. It trades implementation complexity for faster or more compact operations on repeated workloads.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(log n)
Worst
O(n)
Space
O(n)
estimate = alpha_m * m^2 / sum(2^-register_i)Estimates distinct count from the harmonic mean of register values.
Show the structure changing as items are inserted, queried, or removed.
HyperLogLog operates in O(log n) time and O(n) space within the Data Structure family. Key governing relation: estimate = alpha_m * m^2 / sum(2^-register_i). Often compared with Count-Min Sketch and Bloom Filter.
What each reference supports for this entry.
Original reference for HyperLogLog cardinality estimation, stochastic averaging, and register-based estimates.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
HyperLogLog organizes data with different query and update tradeoffs than Count-Min Sketch.