Last active
December 6, 2019 17:57
-
-
Save cesarmiquel/71b0af02f814e677cefc to your computer and use it in GitHub Desktop.
Show all tables (and their row count) for tables with more than 10000 rows for MySQL. Taken from: http://stackoverflow.com/questions/286039/get-record-counts-for-all-tables-in-mysql-database. The second version from here: https://www.lullabot.com/articles/importing-huge-databases-faster
This file contains hidden or 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_name, table_rows, data_length, index_length, | |
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "drupal" | |
ORDER BY round(((data_length + index_length) / 1024 / 1024),2) DESC | |
LIMIT 0,30; |
This file contains hidden or 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_name, table_rows | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_SCHEMA = 'drupal' | |
AND table_rows > 10000 | |
ORDER BY table_rows desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment