Skip to content

Unused Table

Thomas Shone edited this page Sep 18, 2021 · 3 revisions

Issue Type

Operational

Problem

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.

Remediation

# 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;

Considerations

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.

External Resources