In my previous Post, we took a look at the file structure of the InnoDB primary key index. With the same table structure, but a slightly different dataset:
mysql> select * from test_innodb_growth limit 10; +----+------------+--------+ | id | data | spacer | +----+------------+--------+ | 1 | a | | | | 2 | aa | | | | 3 | aaa | | | | 4 | aaaa | | | | 5 | aaaaa | | | | 6 | aaaaaa | | | | 7 | aaaaaaa | | | | 8 | aaaaaaaa | | | | 9 | aaaaaaaaa | | | | 10 | aaaaaaaaaa | | | +----+------------+--------+ 10 rows in set (0.00 sec)
All the rows after id = 10 have data = ‘aaaaa’. Let’s take a look at the secondary index ‘idxdata’. I recently had an argument with a client that claimed that a varchar is fully expanded in a secondary index. The following will prove it is not …
[Read more]