antirez
c3df5965f3
HyperLogLog approximated cardinality caching.
...
The more we add elements to an HyperLogLog counter, the smaller is
the probability that we actually update some register.
From this observation it is easy to see how it is possible to use
caching of a previously computed cardinality and reuse it to serve
HLLCOUNT queries as long as no register was updated in the data
structure.
This commit does exactly this by using just additional 8 bytes for the
data structure to store a 64 bit unsigned integer value cached
cardinality. When the most significant bit of the 64 bit integer is set,
it means that the value computed is no longer usable since at least a
single register was modified and we need to recompute it at the next
call of HLLCOUNT.
The value is always stored in little endian format regardless of the
actual CPU endianess.
2014-04-16 15:23:21 +02:00
..
2012-04-13 18:05:51 -07:00
2013-01-19 11:03:19 +01:00
2012-11-08 18:34:04 +01:00
2013-12-05 16:37:21 +01:00
2013-07-01 10:44:04 +02:00
2013-07-01 10:44:04 +02:00
2013-07-01 10:44:04 +02:00
2013-07-01 10:44:04 +02:00
2013-07-01 10:44:04 +02:00
2014-01-31 15:03:19 +01:00
2014-01-31 15:03:19 +01:00
2014-03-24 21:56:22 +01:00
2012-11-08 18:34:04 +01:00
2013-01-19 11:03:19 +01:00
2012-11-22 10:28:53 +01:00
2014-04-16 15:22:56 +02:00
2014-03-25 09:07:21 +01:00
2013-02-27 12:00:43 +01:00
2012-04-10 16:26:41 +02:00
2012-11-29 14:22:15 +01:00
2014-04-16 15:22:56 +02:00
2014-03-10 23:04:37 +01:00
2014-03-11 10:12:19 +01:00
2013-12-10 18:18:36 +01:00
2012-02-14 16:11:46 +01:00
2012-12-11 17:19:54 +01:00
2013-06-26 15:20:03 +02:00
2013-05-14 11:22:58 +02:00
2014-04-16 15:23:21 +02:00
2012-11-08 18:34:04 +01:00
2012-11-08 18:34:04 +01:00
2010-07-01 14:38:51 +02:00
2010-07-01 14:38:51 +02:00
2010-07-01 14:38:51 +02:00
2013-01-19 11:03:19 +01:00
2014-04-16 15:18:57 +02:00
2013-12-13 13:14:47 +01:00
2013-01-21 12:38:46 +01:00
2014-01-09 11:12:53 +01:00
2013-03-04 10:58:02 +01:00
2013-03-26 13:59:21 +01:00
2014-03-10 15:47:20 +01:00
2014-01-08 17:18:00 +01:00
2014-04-16 15:22:56 +02:00
2013-08-19 15:02:16 +02:00
2012-11-08 18:34:04 +01:00
2013-06-26 15:21:55 +02:00
2012-11-08 18:34:04 +01:00
2012-11-08 18:34:04 +01:00
2014-03-24 21:56:22 +01:00
2013-01-19 11:03:19 +01:00
2013-10-28 18:14:11 +01:00
2012-11-08 18:34:04 +01:00
2013-12-05 16:37:21 +01:00
2014-03-13 15:12:04 +01:00
2014-04-16 15:19:40 +02:00
2014-04-16 15:22:56 +02:00
2013-08-19 15:02:16 +02:00
2013-01-19 11:03:19 +01:00
2014-02-05 16:41:04 +01:00
2014-01-22 09:56:35 +01:00
2013-07-16 15:43:41 +02:00
2014-02-13 12:16:34 +01:00
2014-03-24 10:23:58 +01:00
2013-08-12 11:38:28 +02:00
2014-03-25 08:06:04 +01:00
2013-02-27 12:00:43 +01:00
2013-01-19 11:03:19 +01:00
2010-07-01 14:38:51 +02:00
2012-11-08 18:34:04 +01:00
2012-11-08 18:34:04 +01:00
2012-11-08 18:34:04 +01:00
2014-03-10 15:45:29 +01:00
2012-05-02 22:45:12 +02:00
2013-11-05 17:25:29 +01:00
2013-12-10 18:18:36 +01:00
2013-12-13 11:29:59 +01:00
2014-04-16 15:22:56 +02:00
2013-12-05 16:37:21 +01:00
2012-11-08 18:34:04 +01:00
2013-07-24 18:59:36 +02:00
2013-07-02 12:24:08 +02:00
2011-07-06 15:22:00 +02:00
2014-03-25 11:30:42 +01:00
2013-08-19 15:02:16 +02:00
2012-11-08 18:34:04 +01:00
2013-12-05 16:37:21 +01:00
2013-09-03 15:15:42 +02:00
2014-03-24 12:03:44 +01:00
2014-03-24 12:03:44 +01:00