[Redis] list data structure

A description

Redis is a data structure list (two-way list)


Second, the data structure definition


struct quicklistNode *prev;

struct quicklistNode *next;

The data are current structure quicklistNode definitions from prev and next, and then view additional data such as sz, count and so can not represent stored data, so the actual quicklistNode data storage function is referred to ziplist (compressed bi-list), Links

unsigned char *zl;

Better described quicklistNode a doubly linked list is configured internally by ziplist


Third, the control parameters of ziplist

Because the data is actually carried out inside the store, a node in the end how much data entry stored it through ziplist, this can lead to memory and execution efficiency, the following parameters of this control is:

list-max-ziplist-size -2

1. negative quicklist represented within each node can not exceed the number of bytes ziplist -2 Representative 8kb

2. positive, indicating ziplist quicklist node within each entry not exceed this number positive



Published 140 original articles · won praise 28 · views 180 000 +

Guess you like

Origin blog.csdn.net/qq_16097611/article/details/79920211