redis hashmap数据结构分析

说明一点:redis的hash中每个key都是一个单独的hash表,field是hash表中的key,value是hash表中的value;redis

//redis中hash数据结构为:key-field-value数据结构

hset testMapKey zhangsan 10spa

testMapKey是redis的整个key,对应testMapKey中全部的get

 

//时间复杂度为O(1)  (N为feild的数量)hash

hget testMapKey zhangsantest

根据Jdeis返回值能够验证redis中的一个key就是一个hash表:数据

Map<String, String> strMap = jedisCluster.hgetAll(WAITING_MAP_KEY);di

所以时间

hgetall命令的时间复杂度是O(N) ,N为field的个数co

相关文章
相关标签/搜索