O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

FILES

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required