Redis HyperLogLog PFSELFTEST Command
Created|Updated|Redis Tutorial
|Post Views:
Syntax
The basic syntax of the PFSELFTEST
command is as follows:
1 | PFSELFTEST |
The PFSELFTEST command is an internal command. It is meant to be used for developing and testing Redis.
Available Since
Version 2.8.9 or later.
Time Complexity
N/A
ACL Categories
@hyperloglog
, @admin
, @slow
, @dangerous
Return Value
Returns OK
.
Example
1 | 127.0.0.1:6379> PFSELFTEST |
Author: Johnson Lin
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2024-11-03
Redis HyperLogLog
HyperLogLog is a probabilistic data structure used to estimate the cardinality of a set. As a probabilistic data structure, HyperLogLog trades perfect accuracy for efficient space utilization. Redis added the HyperLogLog data structure in version 2.8.9. HyperLogLog in Redis is an algorithm used for cardinality estimation. Its main advantage is that, even when the number of input elements is extremely large, the memory required to calculate the cardinality remains fixed and small. In Redis,...
2024-10-02
Redis Set SADD Command
The Redis SADD command adds one or more member elements to a set. If an element already exists in the set, it will be ignored. If the set key does not exist, a new set is created with the added elements as its members. If the key is not of the set type, an error is returned. Note: In Redis version 2.4 and earlier, the SADD command only accepts a single member value. SyntaxThe basic syntax of the SADD command is as follows: 1SADD key member [member ...] Available SinceRedis version >=...
2024-11-06
Redis HyperLogLog PFCOUNT Command
The Redis PFCOUNT command returns the cardinality estimate of the given HyperLogLog. SyntaxThe basic syntax of the PFCOUNT command is as follows: 1PFCOUNT key [key ...] Available SinceRedis version 2.8.9 and later. Time Complexity O(1) when called with a single key. O(N) when called with multiple keys, where N is the number of keys. ACL Categories@read, @hyperloglog, @slow Return ValueAn integer representing the cardinality of the given HyperLogLog. If multiple HyperLogLogs are provided,...
2024-11-04
Redis HyperLogLog PFADD Command
The PFADD command in Redis adds one or more elements to a HyperLogLog data structure. SyntaxThe basic syntax for the PFADD command is as follows: 1PFADD key [element [element ...]] This command adds all the specified elements to the HyperLogLog data structure stored at the key provided as the first argument. Available SinceRedis version 2.8.9 and later. Time ComplexityO(1) to add every element. ACL Categories@write, @hyperloglog, @fast Return ValueReturns an integer: 1 if at least one...
2024-11-07
How to Install Redis on Ubuntu Using the APT Command
Redis is a popular, open-source, in-memory data structure store used as a database, cache, and message broker. Installing Redis on Ubuntu is straightforward, thanks to the Advanced Package Tool (APT), which simplifies installing software on Debian-based Linux systems like Ubuntu. Here’s a step-by-step guide on how to install Redis using APT. Step 1: Update Your SystemBefore installing any new software, it’s good practice to update your package lists to ensure you have the latest versions...
2024-11-08
Redis HyperLogLog PFMERGE Command
The Redis PFMERGE command merges multiple HyperLogLogs into a single HyperLogLog. The cardinality estimate of the resulting HyperLogLog is calculated by taking the union of all the given HyperLogLogs. SyntaxThe basic syntax of the PFMERGE command is as follows: 1PFMERGE destkey [sourcekey [sourcekey ...]] The command merges multiple HyperLogLog values to approximate the cardinality of the union of the observed sets. The result is stored in a destination variable, which is created if it...