You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
1017 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Redis的ziplist是一个紧凑的字节数组结构每个元素之间都是紧挨着。
![[Snipaste_2023-02-24_14-42-21 1.png]]
+ 如果存储的是hash结构那么key和value会作为两个entry被相邻存储
+ 如果是zsetvalue和score会作为两个entry被相邻存储
+ 如果set里存储的是字符串那么sadd会升级为hashtable结构HashSet
# 存储界限
当集合对象的元素不断增加或者某个value值过大这种小对象存储也会被升级为标准结构
| 序号 | 规则 |
| ---- | ------------------------------------- |
| 1 | hash的元素个数超过512 |
| 2 | hash的任意元素的key/value的长度超过64 |
| 3 | list 的元素个数超过512 |
| 4 | list的任意元素的长度超过64 |
| 5 | zset 的元素个数超过128 |
| 6 | zset的任意元素的长度超过64 |
| 7 | set 的整数元素个数超过512 |