Is there a way to find the least recently used tables in a MySQL schema? Besides going into data directories? I was hoping there was a metadata or status trick-- but Update_Time in STATUS and INFORMATION_SCHEMA is always NULL.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Given the following:
Database with all MyISAM Tables
Database with all or some InnoDB Tables
This is impossible to do with innodb_file_per_table disabled because all the files reside in a single system tablespace (
Besides data and index pages, there are other things written in the system tablespace:
With innodb_file_per_table disabled, there is no way to tell. As far as I know, the InnoDB Storage Engine does not update the UPDATE_TIME column at all.
With innodb_file_per_table enabled, once an InnoDB table exists outside of
The following is a script that can tell you the LastUpdated Time for MyISAM and InnoDB tables together in one Database (provided you are using innodb_file_per_table)
This script is designed to check the timestamp of every table. The only parameter the table needs is the database.