Redis - HyperLogLog Pfmerge Command



Redis PFMERGE command is used to merge multiple HyperLogLog values into a unique value that will approximate the cardinality of the union of the observed sets of the source HyperLogLog structures.

Return Value

Simple string reply OK.

Syntax

Following is the basic syntax of Redis PFMERGE command.

redis 127.0.0.1:6379> PFMERGE KEY1 KEY@... KEYN

Example

redis 127.0.0.1:6379> PFADD hll1 foo bar zap a 
(integer) 1 
redis 127.0.0.1:6379> PFADD hll2 a b c foo 
(integer) 1 
redis 127.0.0.1:6379> PFMERGE hll3 hll1 hll2 
OK 
redis 127.0.0.1:6379> PFCOUNT hll3 
(integer) 6 
redis_hyperloglog.htm
Advertisements