MySQL index principle

Index operation principle: quickly locate the primary key ID value, obtain the physical address of the corresponding record, and obtain the record information.
Each primary key ID is a node, and the node itself has a pointer.
The lowest-level node is called a "leaf node", which has a direct connection with the physical address of the record

Innodb (primary key) index operation principle:

1.通过索引结构快速定位主键ID值对应的“叶子节点”
2.该叶子节点,里面直接与整条记录信息进行对应(而在MyIsam 里面),叶子节点与物理地址对应)

write picture description here

Additional indexes for Innodb (unique, normal)

The operation principle of this (user name) other index:
1. Through the algorithm inside the index structure, quickly locate the "leaf node" corresponding to the name
2. The key in the leaf node is the record primary key ID value of the keyword
3. Through the record primary key The ID can go to the primary key index

write picture description here
Innodb index:
common index keyword ——> the primary key ID value of the record ————> the entire information of the record

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325686501&siteId=291194637