zoukankan      html  css  js  c++  java
  • redis-原理-对象-hash对象(九)

    hash对象底层的数据结构

    hash对象的编码可以是ziplist(压缩列表)或者linkendlist   注:3.2版本都是用quicklist

    ziplist

    127.0.0.1:0>hset profile name tom
    1
    
    127.0.0.1:0>hset profile age 25
    1
    127.0.0.1>hset profile career Programmer
    

    数据结构

    hashtable

    127.0.0.1:0>hset profile name tom
    1
    
    127.0.0.1:0>hset profile age 25
    1
    
    
    127.0.0.1>hset profile career Programmer

    数据结构

    编码转换

    1.键和值长度都小于64同时键值对个数要小于512使用ziplist否则使用hashtable

    可以通过以下参数进行修改

        hash-max-ziplist-value和hash-max-ziplist-entries

  • 相关阅读:
    linux-满足多字符条件统计行数
    oracle的面试问题
    在开发过程中为什么需要写存储过程
    面向对象编程
    动态SQL
    触发器

    子程序
    游标
    集合
  • 原文地址:https://www.cnblogs.com/LQBlog/p/14803602.html
Copyright © 2011-2022 走看看