Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] How to check when a MySQL table was last SELECTED



Sach Jobb wrote :
> Hello TLUG,
> Oddball MySQL question:
> Does anyone know if there is a way to get when a table was last used
> by a SELECT?
> It would be something I would expect to find in 'SHOW TABLE STATUS
> LIKE ...' but I guess that would be quite expensive to track all of
> the time. Maybe there is an extended stats mode?
> Cheers,
> Sach
>   

You can check when the table was last updated like this way:

select update_time from information_schema.tables where
table_schema='dbname' and table_name='tablename';

but you probably need to store when it was read last time
separately to do exactly what you want to do.

Cheers,
Lewske Wada
Web: http://run.sh/
Email: ryu@example.com
Facebook: Lewske Wada
ICQ: 348990359



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links