PFMERGE
PFMERGE destkey [sourcekey [sourcekey ...]]
- Available since:
- Redis Open Source 2.8.9
- Time complexity:
- O(N) to merge N HyperLogLogs, but with high constant times.
- ACL categories:
-
@write,@hyperloglog,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
Note:
This command's behavior varies in clustered Redis environments. See the multi-key operations page for more information.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.
The computed merged HyperLogLog is set to the destination variable, which is created if it does not exist (defaulting to an empty HyperLogLog).
If the destination variable exists, it is treated as one of the source sets and its cardinality will be included in the cardinality of the computed HyperLogLog.
Required arguments
destkey
The destination HyperLogLog key in which to store the merged result.
Optional arguments
sourcekey [sourcekey ...]
One or more source HyperLogLog keys to merge into destkey. destkey itself is also included in the merge.
Examples
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
Simple string reply:
OK.