当前位置:网站首页>Redis underlying data structure -- listpack
Redis underlying data structure -- listpack
2022-06-13 07:33:00 【A hard-working dog】
listpack Introduce
Redis stay 5.0 A new data structure called listpack, The purpose is to replace compressed lists , Its biggest feature is listpack Each node in no longer contains the length of the previous node , Each node in the compressed list needs to save the length field of the previous node , There will be a hidden danger of chain update .
listpack The structure design
listpack Many excellent designs with compressed lists , such as Or use a contiguous memory space to store data compactly , And to save memory overhead ,listpack Nodes use different encoding methods to save data of different sizes .
listpack There are four parameters
Total bytes Element quantity Node node End tag

listpack entry The node structure
encoding Define the encoding type of the element , Will encode integers and strings of different lengths
data Data actually stored
len,encoding+data The total length of

listpack There is no field in the compressed list to record the length of the previous node ,listpack Only record the length of the current node , When we turn to listpack When adding a new element , It will not affect the change of the length field of other nodes , Thus, the chain update problem of compressed list is avoided .
边栏推荐
- Redis learning journey - persistence
- 关于#etl#的问题:io.trino.jdbc.TrinoDriver
- 不同系统添加证书
- redis-1. Install redis with pictures and texts
- 5. interrupts and exceptions
- China phosphate market in-depth analysis and investment prospect forecast report 2022-2028
- QT读取SQLserver数据库
- 论文笔记: 多标签学习 BP-MLL
- Oracle problem: the data in the field is separated by commas. Take the data on both sides of the comma
- 部署RDS服务
猜你喜欢

Upgrade the project of log4j to log4j2

How idea breaks point debugging

Redis learning journey - persistence

C语言:如何给全局变量起一个别名?

About database: pgadmin4 editing SQL window

Consistency under distributed

Find the first and last positions of elements in a sorted array

How worker threads in the thread pool are recycled

GCC compilation process, function library related compilation process

A solution to the problem that there is always a newline character when C merges multiple RichTextBox contents
随机推荐
关于#数据库#的问题:PGADMIN4 编辑sql窗口问题
Redis learning journey - cache exceptions (CACHE penetration, cache avalanche, cache breakdown)
China phosphate market in-depth analysis and investment prospect forecast report 2022-2028
【ViveFocus使用WaveVR插件获取手柄操作事件】
5xx series problem solving
C # Advanced Programming - Feature Section
Number of detection cycles "142857“
I always don't understand the high address and high position
SDN basic overview
C Advanced Programming - features
Deploy RDS service
Tree list under winfrom treelist related
Sorting of numbers and strings
C语言:如何给全局变量起一个别名?
5. interrupts and exceptions
redis-5. Redis' RDB, fork, copyonwrite, AOF, RDB & AOF are mixed
redis-1. Install redis with pictures and texts
First graphical interface
The management practice of leading enterprises has proved that what is the core of sustainable development of enterprises?
Quick sort