Skip to content

Instantly share code, notes, and snippets.

@d-shimizu
Created August 18, 2020 13:44
Show Gist options
  • Save d-shimizu/fd41de308ad24318243ec1c4fcd79b1a to your computer and use it in GitHub Desktop.
Save d-shimizu/fd41de308ad24318243ec1c4fcd79b1a to your computer and use it in GitHub Desktop.
use sampledb;
SELECT
table_name
, engine
, table_rows
, avg_row_length
, data_free
, floor((data_length+index_length)/1024/1024) as all_size_MB
, floor((data_length)/1024/1024) as data_size_MB
, floor((index_length)/1024/1024) as index_size_MB
FROM
information_schema.tables
WHERE
table_schema=database()
ORDER BY
(data_length+index_length)
DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment