Why can't the red-black tree be used as the index of Mysql

Red-black trees are basically data structures that are only used when stored in memory .

In the case of large-scale data storage, red-black trees often have too many disk IO reads and writes due to the excessive depth of the tree, resulting in low efficiency.

Why does this happen? We know that to get the data on the disk, we must first move the disk moving arm to the cylinder where the data is located, then find the specified disk surface, then rotate the disk surface to find the track where the data is located, and finally read and write the data. The cost of disk IO is mainly spent on the cylinders required for searching. Excessive tree depth will cause frequent disk IO reading and writing. According to the number of disk search accesses are often determined by the height of the tree, so as long as we try to reduce the height of the tree through a better tree structure , the B-tree can have multiple children, from tens to thousands, which can be reduced The height of the tree.

Guess you like

Origin blog.csdn.net/a1_HelloWord/article/details/104300363