-
Notifications
You must be signed in to change notification settings - Fork 6
Unused Table
Thomas Shone edited this page Sep 18, 2021
·
3 revisions
Operational
By examining the performance_schema.table_io_waits_summary_by_table
table, we can determine if a table has been used since the last server restart.
# It is always a good idea to rename a table first, before dropping it.
# This way you can quickly rename it back if anything relied on it.
RENAME TABLE t1 TO t1_to_be_dropped
# Wait a little while and then drop the table
DROP TABLE t1_to_be_dropped;
This check only looks at the usage of a table since the database server was last run. If you ran this on a non-production environment, then you can probably ignore this check.