SQL optimization - primary key optimization, page splitting, page merging, primary key design principles

1. Primary key optimization

In the data structure of this b+ tree, all the data will appear in the leaf nodes, and the sub-leaf nodes only serve as an index data. The index of the sub-leaf nodes and the data of the leaf nodes are finally stored in a structure, among the pages (pages), all the yellow blocks in the figure below are pages (pages), and the size of each page is fixed. The page is the smallest unit of innoDB disk management
insert image description here
.
insert image description here

1.1 Page Splitting

The way the primary key is inserted in order
insert image description here
Page splitting may occur when the primary key is out of order. Linked list pointers between pages are reset
insert image description here

1.2 Page merge

insert image description here

1.3 Primary key design principles

insert image description here

Guess you like

Origin blog.csdn.net/weixin_44860226/article/details/131866090