Analyzing and Optimizing MySQL Table Space Usage
-- Identify databases with unused space
SELECT
table_schema AS database_name,
table_name,
data_free,
ENGINE
FROM information_schema.tables
WHERE table_schema NOT IN ('sys', 'mysql', 'performance_schema', 'information_schema', 'test')
AND data_free > 0;
-- Calculate total storage per database
SELECT
table_schema AS dat ...
Posted on Fri, 15 May 2026 13:26:36 +0000 by huszi001