Redis HyperLogLog PFSELFTEST Command
发表于|更新于|Redis Tutorial
|浏览量:
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 |
文章作者: Johnson Lin
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Johnson Lin!
相关推荐
2024-10-12
Redis Set SMOVE Command
The Redis SMOVE command moves the specified member element from the source set to the destination set. SMOVE operation is an atomic. If the source set does not exist or does not contain the specified member, the command does nothing and returns 0. Otherwise, the member is removed from the source set and added to the destination set. If the destination set already contains the member, the SMOVE command simply removes the member from the source set without adding it to the destination set again...
2019-12-19
Spring Boot 2.x 集成Redis示例
一、如何集成首先,在 pom 文件新增 redis 依赖: 1234<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency> 接着修改项目配置文件 application.properties,增加 redis 配置 1234# redis hostspring.redis.host=172.24.58.226# redis portspring.redis.port=6379 经过上面简单的两步,即可在项目中使用 StringRedisTemplate 和 RedisTemplate<Object,Object>,因为从 Spring Boot 2.0 开始,Spring 容器是自动生成了这两个实例,可以直接注入使用。如以下代码片段: 12345678910111213@Autowiredprivat...
2024-10-20
Redis Bitmap BITCOUNT Command
The Redis BITCOUNT command count the number of set bits (population counting) in a string. SyntaxThe basic syntax of the BITCOUNT command is as follows: 1BITCOUNT key [start end [BYTE | BIT]] By default all the bytes contained in the string are examined. It is possible to specify the counting operation only in an interval passing the additional arguments start and end. Like for the GETRANGE command start and end can contain negative values in order to index bytes starting from the end of the ...
2023-06-02
Redis DECRBY 命令
语法1DECRBY key decrement 可用版本 ≥ 1.0.0 时间复杂度 $O(1)$ ACL 类别 @write, @string, @fast 将存储在 key 的数字值减去 decrement。如果 key 不存在,则先将 key 的值初始化为 0,然后再执行 DECRBY 操作。如果 key 包含一个错误类型的值或包含一个不能表示为整数的字符串,则返回错误。这个操作仅限于 64 位有符号的整数。 返回值返回一个整数,表示执行 DECRBY 操作后,key 对应的值。 示例 1对已存在且其值类型为整数的 key 进行 DECRBY 操作: 12345redis> SET cnt 1000OKredis> DECRBY cnt 1(integer) 999redis> 示例 2对不存在的 key 进行 DECRBY 操作: 1234567redis> EXISTS cnt(integer) 0redis> DECRBY cnt 1(integer) -1redis> GET cnt"-1"redis> ...
2024-10-01
Redis Set
In Redis, a Set is an unordered collection of unique String elements. This means that duplicate values are not allowed within a Set. The Set’s underlying data structure can either be an intset or a hashtable. Since Redis Sets are implemented using hash tables, the time complexity for adding, removing, or checking for members is O(1). A Set can have a maximum of 2^32 - 1 (4,294,967,295) members, which means each Set can store over 4 billion elements. Example12345678910111213127.0.0.1:6379> ...
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 doesn’...


