当前位置:网站首页>[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 .
边栏推荐
- The motivation of AES Advanced Encryption Protocol
- Webrtc audio and video capture and playback examples and mediastream media stream analysis
- Sword finger offer II 099 Sum of minimum paths - double hundred code
- 地平线2022年4月最新方案介绍
- 编辑卡顿
- [NPUCTF2020]ezlogin xPATH注入
- Loss function~
- ping域名报错unknown host,nslookup/systemd-resolve可以正常解析,ping公网地址通怎么解决?
- Editor Caton
- LC173. 二叉搜索树迭代器
猜你喜欢

AES高級加密協議的動機闡述
![[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM](/img/5d/c23ec16df6ce8d78207b635f59dc20.png)
[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM

Set right click to select vs code to open the file

China Academy of information technology, Tsinghua University, Tencent security, cloud native security, industry university research and use strong alliance!

海思3559万能平台搭建:在截获的YUV图像上画框
![[Solved] Splunk: Cannot get username when all users are selected“](/img/13/1e824c8005701e21fc5b4e73308d53.png)
[Solved] Splunk: Cannot get username when all users are selected“

Analyse des données dossiers d'apprentissage - - analyse simple de la variance à facteur unique avec Excel

MySQL reset password, forget password, reset root password, reset MySQL password

設置單擊右鍵可以選擇用VS Code打開文件

PotPlayer设置最小化的快捷键
随机推荐
在SOUI里使用真窗口时使用SOUI的滚动条
PMP project integration management
數據分析學習記錄--用EXCEL完成簡單的單因素方差分析
20220524_数据库过程_语句留档
Static file display problem
Ping domain name error unknown host, NSLOOKUP / system d-resolve can be resolved normally, how to Ping the public network address?
Li Kou brush questions (2022-6-28)
成功改变splunk 默认URL root path
归并排序详解及应用
Lambda表达式:一篇文章带你通透
阿里云有奖体验:如何使用 PolarDB-X
静态文件显示问题
China Academy of information technology, Tsinghua University, Tencent security, cloud native security, industry university research and use strong alliance!
MySQL reset password, forget password, reset root password, reset MySQL password
剑指 Offer II 099. 最小路径之和-双百代码
潘多拉 IOT 开发板学习(HAL 库)—— 实验4 串口通讯实验(学习笔记)
密码技术---分组密码的模式
泛型与反射,看这篇就够了
Qt QProgressBar详解
Alibaba cloud award winning experience: how to use polardb-x