MySQL - How to Show Data and Index Size in your Tables
July 1, 2025
note-to-self
How to show data and index size in your mysql tables.
select table_schema, TABLE_NAME, dat, idx from
(SELECT table_schema, TABLE_NAME,
( data_length ) / 1024 / 1024 as dat,
( index_length ) / 1024 / 1024 as idx
FROM information_schema.TABLES
order by 3 desc ) a
order by 3 desc
limit 10;
These posts are for my own understanding. Reader beware. Info may be wrong but it reflects my current understanding.