Search code examples
mysqlinnodbauto-increment

Structure of auto increment index in MySQL,InnoDB


When I use auto increment index,it is more efficient. ---《High Performance MySQL》

High Performance MySQL enter image description here

But B+ tree's build process is flow:

B+ tree build enter image description here

It is not full or 15/16 ,only half in the red circle,and never insert data in the future in the red circle when I use auto increment index.

So,it is contradictory.

And I guess,mysql although used B+ tree as index, but auto increment index not use the build way of B+ tree, mysql redesigned his own strategy for high performance.

Is my guess right?


Solution

  • ok,I find the answer. because mysql have special optimization treatment.if the key is auto increment,build b+tree in the first way,otherwise,build b +tree in the second way.