0

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?

2 Answers 2

0

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.

0

To reclaim space I would advise running an no-op online scheme change;

alter table {table_name} engine = innodb;

^ the above DDL can be completed with pt-online-schema-change online but be sure to read the docs before you start to avoid unexpected behavior.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.