Last active
August 29, 2015 14:12
-
-
Save morkot/72db3fabcbba36f755df to your computer and use it in GitHub Desktop.
Calculate number of rows in all MySQL databases with total sum (rough)
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 IFNULL(TABLE_SCHEMA, 'total') as table_schema, SUM(TABLE_ROWS) as element_count | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_SCHEMA IN (SELECT schema_name FROM information_schema.schemata) | |
GROUP BY TABLE_SCHEMA WITH ROLLUP; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment