title: MySQL reclaim disk space, with OPTIMIZE table
body: <p>I need your advice. Need to reclaim disk space on live server with minimum downtime. We are using:</p>
  
  <pre><code>mysql -- 5.5
  innodb table per file -- on
  </code></pre>
  
  <p>Was a huge table(70% insers/30% deletes -- it means that sometimes we delete rows from this table), this table was dropped with "drop table" command, as we expect, mysql didn't release disk space to OS, but now we need to release free space. OPTIMIZE command is possible way -- but now we don't 100% sure if we will have enough free space on disk to do this command, because previous table was huge. But in mysql documentation written:</p>
  
  <blockquote>
    <p>You can run OPTIMIZE TABLE to compact or recreate a file-per-table tablespace. When you run an OPTIMIZE TABLE, InnoDB creates a new .ibd file with a temporary name, <strong>using only the space required to store actual data</strong>. When the optimization is complete, InnoDB removes the old .ibd file and replaces it with the new one.</p>
  </blockquote>
  
  <p>I highlighted confusing moment in documentation, does it means, that "OPTIMIZE dropped_table;" will use only space for data that really needed, for this situation there is no <strong>actual</strong> data if we drop table early ?</p>