Search code examples
mysqldrop-table

Is it ok to drop a 99G mysql table without effect?


I want to drop a 99G mysql table A, table A is useless now, Is it ok to execute the cmd 'drop table A'.I wish no effect on other table's operations.


Solution

  • Occasionally dropping a large table can lock the InnoDB buffer pool for some time, while it purges pages for that table.

    For this reason, in my company when we "drop" a table, we really just rename it, and move it to another schema. We leave it alone for 7 days, to allow queries against other tables to gradually evict the table's pages from the buffer pool. Then we drop the useless table.

    We do this on tables much larger than yours, sometimes up to 10x larger.

    If your table has already been unused for some days, you can probably just drop it now.