Recently, I found a very handy tool, innodb-recovery, that can break an InnoDB file in pages. I am a visual type person so what a better occasion to try to learn more about the InnoDB file structure. To explore the file structure, I used the following table:
Create Table: CREATE TABLE `test_innodb_index` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` varchar(50) DEFAULT NULL, `spacer` char(1) DEFAULT NULL, PRIMARY KEY (`id`), KEY `idxdata` (`data`) ) ENGINE=InnoDB AUTO_INCREMENT=1901 DEFAULT CHARSET=latin1
and inserted a bunch of rows like these:
select * from test_innodb_index limit 4; +----+-------+--------+ | id | data | spacer | +----+-------+--------+ | 1 | aaaaa | | | | 2 | aaaaa | | | | 3 | aaaaa | | | | 4 | aaaaa | | | +----+-------+--------+ 4 rows in set (0.00 sec)
After the insertion, the table status looked like this:
mysql> show table status like …[Read more]