Redis HyperLogLog PFDEBUG Command
Created|Updated|Redis Tutorial
|Post Views:
Syntax
The basic syntax of the PFDEBUG command is as follows:
1 | PFDEBUG subcommand key |
The PFDEBUG 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
@write, @hyperloglog, @admin, @slow, @dangerous
Author: Johnson Lin
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2023-06-09
Redis PFMERGE 命令
语法1PFMERGE destkey [sourcekey [sourcekey ...]] 可用版本 ≥ 2.8.9 时间复杂度 $O(N)$ N 为需要的 HyperLogLog 的数量。 ACL类别 @write, @hyperloglog, @slow 将多个 HyperLogLog 合并为一个 HyperLogLog,合并后的 HyperLogLog 的基数估算值是通过对所有给定 HyperLogLog 进行并集计算得出的。 合并后的 HyperLogLog 会被储存在 destkey 键里面,如果该键并不存在,那么命令在执行之前,会先为该键创建一个空的 HyperLogLog。如果该键存在,则将其视为源集之一,其基数将包含在计算的 HyperLogLog 的基数中。 简单来说就是,把多个 HyperLogLog 合并到一起,得到一个代表并集基数的HyperLogLog,如果目标 key 存在,也会一起合并,得到的目标 key 就是最终的合并结果。 返回值返回 OK。 示例 1将两个 HyperLogLog 合并为一个 HyperLogLog,并储存在一个不存在的键上:...
2024-10-06
Redis Set SINTER Command
The Redis SINTER command returns the members of the set resulting from the intersection of all the given sets. Keys that do not exist are considered to be empty sets. With one of the keys being an empty set, the resulting set is also empty (since set intersection with an empty set always results in an empty set). For example: 1234key1 = {a,b,c,d}key2 = {c}key3 = {a,c,e}SINTER key1 key2 key3 = {c} SyntaxThe basic syntax of the SINTER command is as follow...
2024-10-05
Redis Set SDIFFSTORE Command
The Redis SDIFFSTORE command stores the difference between the specified sets in a given destination set. If the destination set already exists, it will be overwritten. SyntaxThe basic syntax of the SDIFFSTORE command is as follows: 1SDIFFSTORE destination key [key ...] This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination. Available SinceRedis version >= 1.0.0 Time ComplexityO(N) where N is the total number of elements in all given sets. A...

2024-09-11
Analyzing Redis Source Code: The Structure and Design of Hash Tables, Chained Hashing, and Incremental Rehashing
Redis offers a classic implementation of hash tables. To handle hash collisions, Redis employs chained hashing, which links data with the same hash value in a list rather than expanding the table. This ensures that all data remains accessible within the hash table. To minimize the performance impact of rehashing, Redis uses a incremental rehashing strategy, which distributes the workload of rehashing over time to reduce system overhead. In this article, I’ll guide you through the core desig...
2024-10-17
Redis Set SUNION Command
The Redis SUNION command returns the union of the specified sets. Keys that do not exist are considered to be empty sets. SyntaxThe basic syntax of the SUNION command is as follows: 1SUNION key [key ...] For example: 1234key1 = {a,b,c,d}key2 = {c}key3 = {a,c,e}SUNION key1 key2 key3 = {a,b,c,d,e} Available SinceRedis version >= 1.0.0 Time ComplexityO(N) where N is the total number of elements in all given sets. ACL Categories@read, @set, @slow Return ...
2023-06-02
从源代码编译和安装 Redis
我们可以在主流操作系统(包括 Windows、Linux 和 macOS)上从源代码编译和安装 Redis。Redis 除了 C 编译器和 libc 之外没有其他依赖。 Redis可以在以下系统上编译和安装: Linux - 包括 Ubuntu,RedHat,Arch Linux 等发行版。 macOS 其他类 UNIX 系统 - 如 FreeBSD,OpenBSD。 Windows - 需要安装 MinGW 并编译 Windows 版本的 Redis。 要从源代码编译 Redis,需要: 安装 git 并克隆 Redis 最新版本的源代码: 1git clone https://github.com/redis/redis.git Redis 的源文件也可以从官方下载页 [https://redis.io/download] 直接下载获得。可以通过对照 redis-hashes git 仓库中的摘要来验证这些下载文件的完整性。 要从 Redis 下载站点获取最新稳定版 Redis 的源文件,请运行: 1wget https://download.redis.io/red...