redis数据结构
2021-12-25 23:55:22 3 举报
redis底层数据结构
作者其他创作
大纲/内容
entry3
type
privdata
dictht ht[2]
regashidx
iterators
dictEntry
L2
L4
ht[0]
L0
header
tail
length
level
L1
zlbytes: 32bit
zltail: 32bit
zllen: 16bit
zlend:255: 8bit
1bit
根据len字段的第一个字节分9中情况
buf
encoding
lru:LRU_BITS
refcount
*ptr
head
count
......
sds
alloc
dictht
Lo
len
free
buf[]
Len
*key
v
*val
u64
s64
d
*next
0
1
2
3
zset-skiplist
不同数据类型所对应实际编码对象
entry
根据数据项是否小于254prerawlen数据占的位数不一样
zipList
zset-zipList
prerawlen
ele2-val
zskiplListLevel
entry4
prev
next
zl
2byte
1byte
Type
rawembstrintziplist......
string
list
hash
set
zset
dict
*forward
span
b
200
*backword
int
raw
embstr
quicklist
hashtable
ziplist
intset
skiplist
ele1-score
zskiplist
Null
L3
sdshdr8
1byte: 254标记
4byte
zskiplistNode
entry2
ele
score
c
300
dict *dict
expires
blocking_keys
ready_keys
watched_keys
id
avgttl
expires_cursor
defrag_later
flags
redisObject
data
a
100
ht[1] -> NULL
stringlisthashsetzset
RedisDb
**table
size
sizemask
used
sdshdr5
entry1
ele2-score
ele1-val
0 条评论
下一页