Bug #43223 Provide a way to check when statistics for the table was updated last time
Submitted: 26 Feb 2009 11:18 Modified: 26 Feb 2009 11:19
Reporter: Valeriy Kravchuk Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[26 Feb 2009 11:18] Valeriy Kravchuk
Description:
Sometimes ANALYZE TABLE helps to give proper statistics/cardinalty estimations for the optimizer to choose proper access path. But there is no way to check when it was called (successfully!) last time and/or when statistics for the table was updated by any other means (like server startup, SHOW, OPTIMIZE etc). So, we either have to blindly run ANALYZE for each and every table, or end up with bad plans for some queries that were easily avoidable by executing ANALYZE.

How to repeat:
Try to find out when ANALYZE TABLE was executed last time for the given table.

Suggested fix:
Please, provide this information in SHOW TABLE STATUS or one of INFORMATION_SCHEMA tables, or elsewhere.