I ported/reimplemented show table_statistics for the Facebook patch on Launchpad. This first appeared in the Google patch. In this patch the Database and Rows_requested columns have been added and the Rows_changed_x_indexes column removed. This adds two commands: show table_statistics to report on per-table activity and flush table_statistics to reset the counters. Data is only collected for non-temporary MyISAM and InnoDB tables.
This is always enabled. I think it has minimal impact on performance and tests are in progress to verify that. But it is probably a bad idea to run flush table_statistics in a loop without sleeping.
One entry is listed for each table for which there was activity and includes the following …
[Read more]