Skip to content

Instantly share code, notes, and snippets.

@jeremycohensolal
jeremycohensolal / mysql_table_space.sql
Created August 2, 2017 15:17
My favorite MySQL queries for table space analysis
/*
USE IT WITH CAUTION (could overload and impact your production server...)
Feel free to add your own suggestion
Made for a MySQL 5.5 database
*/
-- Biggest db (full schema)
SELECT
TABLE_SCHEMA,
SUM(ROUND(DATA_LENGTH/1024/1024,2)) as data_length_mb,