Last active
October 30, 2020 11:38
-
-
Save mgttt/5b5fe34923808cc70bc09d55cc0ce86c to your computer and use it in GitHub Desktop.
mysql table size etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS,DATA_LENGTH,INDEX_LENGTH FROM information_schema.TABLES | |
where DATA_LENGTH+INDEX_LENGTH >0 and TABLE_SCHEMA not in ('mysql','sys','information_schema'); | |
select * from information_schema.TABLES limit 1; |
Author
mgttt
commented
Oct 19, 2020
•
SELECT table_schema, table_name, engine
, table_rows,update_time
,avg_row_length
FROM information_schema.tables
WHERE table_schema NOT IN ('mysql','sys','information_schema','performance_schema')
ORDER BY table_rows * avg_row_length
DESC;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment