Saturday 18 April 2015

PFCOUNT key1 key2 ... keyN

Syntax
PFCOUNT key1 key2 ... keyN

When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

When called with multiple keys, returns the approximated cardinality of the union of the HyperLogLogs passed, by internally merging the HyperLogLogs stored at the provided keys into a temporary hyperLogLog.

The returned cardinality is approximated with a standard error of 0.81%.

127.0.0.1:6379> pfadd sample 1 2 3 4 5 
(integer) 1 
127.0.0.1:6379> pfadd example 6 7 8 9 
(integer) 1 
127.0.0.1:6379> pfcount sample example 
(integer) 9 
127.0.0.1:6379> pfcount sample 
(integer) 5 
127.0.0.1:6379> pfcount example 
(integer) 4 
127.0.0.1:6379> 


 
Prevoius                                                 Next                                                 Home

No comments:

Post a Comment