Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the physical structure of InnoDB secondary index pages looks like

Tags:

mysql

innodb

According to this https://dev.mysql.com/doc/internals/en/innodb-fil-header.html and did some searching on google. I can see that a record is stored in the user records area on the page with it's FIL_PAGE_TYPE = FIL_PAGE_INDEX(17855 also 0x45BF).

But I am now confused about the secondary index. Did it stored on the same page type with the FIL_PAGE_TYPE = FIL_PAGE_INDEX?

I created a table with some index, added some data. Found that my ibd file contains a FIL_PAGE_INODE page. So I am guessing that the secondary index was stored on the page with FIL_PAGE_TYPE = FIL_PAGE_INODE .

If so, How can I found the index content on that page?

like image 360
Jason Young Avatar asked Nov 22 '25 05:11

Jason Young


1 Answers

Secondary indexes do indeed use FIL_PAGE_INDEX just as the primary/clustered key does. There is no structural difference between the primary key and any secondary indexes. The FIL_PAGE_INODE page type is part of the space management system, and is described in my blog post on Page management in InnoDB space files.

like image 53
jeremycole Avatar answered Nov 24 '25 23:11

jeremycole



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!