January 2018
Intermediate to advanced
446 pages
12h 57m
English
You have already seen that MySQL stores the InnoDB data in the .ibd files inside a directory (with the same name as the database name) in the data directory . To get more information about the files, you can query the FILES table:
mysql> SELECT * FROM FILES WHERE FILE_NAME LIKE './employees/employees.ibd'\G~~~EXTENT_SIZE: 1048576AUTOEXTEND_SIZE: 4194304DATA_FREE: 13631488~~~
You should be keen at DATA_FREE, which represents the unallocated segments plus the data that is free inside the segments due to fragmentation. When you rebuild the table, you can free up bytes shown in DATA_FREE.