Is the bottom of B + tree of InnoDB engine in MySQL database one-way or two-way?

Time:2020-12-9

One way or two way? Different opinions!

There are two kinds of two-way search on the Internet. So which one is right? We’re going to decrypt it today

Official documents

talk is cheap,show me the code

The truth

The concept of page

The InnoDB of MySQL uses pages as the storage unit. Each leaf node of B + tree is a multiple of the size of a page. The default size of a page is 16K
The page structure is shown in the figure below
Is the bottom of B + tree of InnoDB engine in MySQL database one-way or two-way?
In other words, each page contains two page pointers, one is the previous page pointer, which points to the previous page, and the other is the next page pointer, which points to the next page.
The header also contains the type information of the page and the number used to uniquely identify the page. According to this pointer distribution, you can imagine that pages linked together are a two-way linked list.
As shown in the figure below
Is the bottom of B + tree of InnoDB engine in MySQL database one-way or two-way?
Since a leaf node of a B + tree is composed of a page or an integer multiple of a page, there is a bidirectional linked list structure between each leaf node.
Is the bottom of B + tree of InnoDB engine in MySQL database one-way or two-way?

reference resources

https://segmentfault.com/a/11…
https://www.jianshu.com/p/486…

Recommended Today

JS function

1. Ordinary function Grammar: Function function name (){ Statement block } 2. Functions with parameters Grammar: Function function name (parameter list){ Statement block } 3. Function with return value Grammar: Function function name (parameter list){ Statement block; Return value; } Allow a variable to accept the return value after calling the function Var variable name […]