Redis PFMERGE Command

Redis HyperLogLog

The Redis PFMERGE command merges multiple HyperLogLogs into one HyperLogLog. The cardinality estimation of the merged HyperLogLog is calculated by performing a union of all the given HyperLogLogs.

Syntax

The basic syntax of the redis PFMERGE command is as follows:

PFMERGE destkey sourcekey [sourcekey ...]

Available versions

>= 2.8.9

Return value

Returns OK.

Examples

redis> PFADD hll1 foo bar zap a
(integer) 1
redis> PFADD hll2 a b c foo
(integer) 1
redis> PFMERGE hll3 hll1 hll2
"OK"
redis> PFCOUNT hll3
(integer) 6
redis>  

Redis HyperLogLog

Other extensions