I have a lot of tables in my database, almost 1,000. Most of them I am not using now.
Is there any way to know from the information schema tables when I have last used my tables?
information-schemaMySQL
I have a lot of tables in my database, almost 1,000. Most of them I am not using now.
Is there any way to know from the information schema tables when I have last used my tables?
Best Answer
No, that information is not available on
INFORMATION_SCHEMA
(it only stores metadata).There are several options that I can recommend you:
long_query_time = 0
(be careful of the extra overhead and disk space and then analyze per table used, so you can detect the last time it was used. Tools likept-query-digest --review
aggregate by query, not by table, but they may be useful to look for specific queries.All of them will tell you information since the point you activate them, and not past information. UNIX atime is very unreliable for access time, but you may also want to give that a try, depending on the engine.