redis集合

Kuroba_thief發表於2020-12-30

Redis集合底層實現是雜湊表或整數陣列,如下圖所示

127.0.0.1:6379> SADD names "lxx" "xuming"
(integer) 2
127.0.0.1:6379> object encoding names
"hashtable"



127.0.0.1:6379> SADD ages 11 12 13
(integer) 3
127.0.0.1:6379> smembers ages
1) "11"
2) "12"
3) "13"
127.0.0.1:6379> object encoding ages
"intset"

 

相關文章