Get table size in GB
SELECT
table_schema as `Database`,
table_name AS `Table`,
table_rows AS "Quant of Rows",
round(((data_length + index_length) / 1024 / 1024/ 1024), 2) `Size in GB`
FROM information_schema.TABLES
WHERE table_schema = 'YOUR_DATABASE_NAME'
ORDER BY (data_length + index_length) DESC;
Get table size in MB
SELECT
table_schema as `Database`,
table_name AS `Table`,
table_rows AS "Quant of Rows",
round(((data_length + index_length) / 1024 / 1024/ 1024), 2) `Size in GB`
FROM information_schema.TABLES
WHERE table_schema = 'YOUR_DATABASE_NAME'
ORDER BY (data_length + index_length) DESC;
No comments:
Post a Comment