当前位置:网站首页>[redis notes] compressed list (ziplist)
[redis notes] compressed list (ziplist)
2022-07-02 23:11:00 【Twilight_ years】
Definition of compressed list :
Compressed lists are developed to save memory , It is a sequential data structure composed of a series of special coded continuous memory blocks .
Structure of compressed list :
Structure of compressed list nodes :
previous_entry_length: Record the length of the previous node in the compressed list
according to previous_entry_length, The program can operate by pointer , Calculate the starting address of the previous node according to the starting address of the current node , So as to realize traversal from the end of the table to the header .
encoding:
Record node's content The type and length of data saved by attributes
content:
Responsible for saving the value of the node , The node value can be an array of bytes or an integer , The type and length of the value are determined by the encoding Attribute decision .
Chain update :
Add or remove nodes , If the length is greater than 254 byte , It may lead to previous_entry_length Size needs to be from 1 Bytes changed to 5 byte , This may cause subsequent nodes previous_entry_length Everything has changed , under these circumstances , Continuous space expansion operations are required .
explain :
(1) The worst time complexity of space allocation O(N), The worst time complexity of chain update O(N Fang )
(2) The situation is rare and as long as the number of nodes is small , No impact on performance .
边栏推荐
- Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月1日08:43:06
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验3 按键输入实验(学习笔记)
- Motivation du Protocole de chiffrement avancé AES
- QT qpprogressbar details
- Cryptography -- the mode of block cipher
- Lc173. Binary search tree iterator
- 抖音实战~点赞数量弹框
- STM32之ADC
- [npuctf2020]ezlogin XPath injection
- 力扣刷题(2022-6-28)
猜你喜欢
最小生成树 Minimum Spanning Tree
Jielizhi, production line assembly link [chapter]
Mask R-CNN
C#中Linq用法汇集
[NPUCTF2020]ezlogin xPATH注入
程序员版本的八荣八耻~
[Solved] Splunk: Cannot get username when all users are selected“
[hardware] origin of standard resistance value
The first batch of Tencent cloud completed the first cloud native security maturity assessment in China
[Yangcheng cup 2020] easyphp
随机推荐
Generics and reflection, this is enough
Freshman learning sharing
潘多拉 IOT 开发板学习(HAL 库)—— 实验3 按键输入实验(学习笔记)
Application of containerization technology in embedded field
Jerry's charge unplugged, unable to touch the boot [chapter]
Minimum spanning tree
1px pixel compatibility of mobile terminal, 1px border
[羊城杯2020]easyphp
力扣刷题(2022-6-28)
Strictly abide by the construction period and ensure the quality, this AI data annotation company has done it!
C#中Linq用法汇集
QT qpprogressbar details
海思3559万能平台搭建:在截获的YUV图像上画框
Jerry's built-in short press and long press, no matter how long it is, it is a short press [chapter]
Use the scroll bar of souI when using the real window in souI
Qt QProgressBar详解
Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月1日08:43:06
分布式监控系统zabbix
PotPlayer设置最小化的快捷键
Antd component upload uploads xlsx files and reads the contents of the files