Created
July 19, 2018 20:43
-
-
Save aabumuslimov/58ee86e244bbc331084b285fe8a72e27 to your computer and use it in GitHub Desktop.
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 "DB Total" AS "Table", | |
ROUND(SUM(data_length) / 1048576) AS "Data", | |
ROUND(SUM(index_length) / 1048576) AS "Index", | |
ROUND(SUM(data_length + index_length) / 1048576) AS "Total" | |
FROM information_schema.TABLES | |
WHERE table_schema = "7523") | |
UNION ALL | |
(SELECT | |
table_name, | |
IF(data_length > 0 AND data_length < 104857.6, 0.1, ROUND(data_length / 1048576, 1)), | |
IF(index_length > 0 AND index_length < 104857.6, 0.1, ROUND(index_length / 1048576, 1)), | |
IF(data_length + index_length > 0 AND data_length + index_length < 104857.6, 0.1, ROUND((data_length + index_length) / 1048576, 1)) | |
FROM information_schema.TABLES | |
WHERE table_schema = "7523") | |
ORDER BY total DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment