dataiotech Labs
dbaguidedbaguideDBAdataxtoolsdataopsphere
Scripts Library/mysql/#39
Script #39
mysql
Performanceread-onlyMin Version: 5.7

MySQL I/O Load by File

Ranks the most read and written files in bytes. Shows which table or file causes disk bottlenecks.

#io#performance_schema#disk
mysql · sql
SELECT file, count_read, total_read, count_write, total_written, total
FROM sys.io_global_by_file_by_bytes
LIMIT 20;
Operational Notes & Remediation Guidance

Verify in a staging environment prior to running in production. This is a read-only diagnostic query; it does not acquire exclusive locks.

Production Safety & Execution Standards
  • This script is designed for read-only diagnostics; it does not alter schema or modify data directly.
  • Prior to executing on production systems under high load, verify the target database version (Min. Version: 5.7).
  • Exercise caution with mutating actions (e.g., terminating sessions or dropping indexes) referenced in the notes section.