Mysql – tablename.ibd file is huge in size

disk-spaceinnodbMySQLmysql-5.6

I'm using MySQL 5.6 and innodb file per table has been enabled.

I noticed that one file named as tablename.ibd is 211GB, then query the information schema there it's showing 21GB.

I have done a huge delete operation on this table. And daily archiving some old data.

Is this because of that?
Optimize table – command is the only way to reclaim the space?

Best Answer

If you have enabled innodb_file_per_table, the only way in Operative System can recover and demand to MySQL the used space is through OPTIMIZE TABLE command, you should run that command for you could see equally the data in both ways through .ibd file and using query.