OPTIMIZE TABLE innodb file per table while system is running
Solution 1:
Before you need to do the next big delete, read the following blog and plan on doing the delete a more efficient way: http://mysql.rjweb.org/doc.php/deletebig
Meanwhile, users can continue to use the table, even though there is a lot of wasted space on disk. That is, do nothing.
If disk space is a concern, _and the table was created while innodb_file_per_table
was ON
, the OPTIMIZE TABLE
will shrink the disk footprint, at some cost of user access. You may have noticed that the Delete had an impact on user access. (My blog shows ways to avoid such impact.)
If you do nothing, the 800GB file will gradually fill with newly Inserted rows. This may be fine.