最近(でもないけど) information_schema.tables
の中身を1日1回程度取得してMySQLに突っ込んでいる。
/*!80013 SET SESSION information_schema_stats_expiry = 0; */
SELECT
table_schema AS table_schema,
table_name AS table_name,
table_rows AS table_rows,
data_length AS data_length,
index_length AS index_length,
data_free AS data_free,
engine AS engine,
NOW() AS last_update
FROM
information_schema.tables
WHERE
table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys') AND
table_type = 'BASE TABLE'
ORDER BY
data_length + index_length DESC;
CREATE TABLE `table_status_info` (
`seq` bigint unsigned NOT NULL AUTO_INCREMENT,
`ipaddr` varchar(15) NOT NULL,
`port` smallint unsigned NOT NULL, …
[さらに読む]