I need to be able to find out the last time a table was accessed. Other than adding a column, is it possible to get this information?
Thanks, Florian
oh, sorry, btw it's a mysql database
Hi,
Was not sure about this. I found this on the manual, which NOT what you asked for, but may help you find a solution: http://dev.mysql.com/doc/refman/4.1/en/query-cache-status-and-maintenance.html
I don't think MySQL stores that information by default.
In any case, how meaningful would those data be? Surely anything like a backup script or "show table status" might touch the table and count as an access?
Mark
Couldn't you just have a table containing the table names and have a TIMESTAMP field for each one and update it after each query???
There has to be some way to do it, because PHPMyAdmin gives you this information when you look at the structure of a table, under "Row Statistics" (seems like a weird title), there's a creation date + time for the table, as well as a "last update" date + time. I guess "update" may not be the same as "access", but it may be a step in the right direciton.
clark - good thinking! I say that because I had the same idea -- it's plan b
mberman - yeah, that's what got me to believe that that variable might available in the first place...
thanks for your time, Florian
mark - good point, I guess what information I need is the last time information was added or selected from that table ... I suspect that that information may be hard to come by...
I think you should go with ClarKF1's suggestion. An easy way to do this is to do have Stored Procedures that you call when you need to insert data or retrieve data or.... and have them perform the action & write on the table that holds the access dates...