Created
July 24, 2015 08:07
-
-
Save anonymous/fb6dbc30662008a4525d 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
$results3 = client.query("SELECT table_schema AS 'Database name', SUM(data_length + index_length) / 1024 / 1024 AS 'Size (MB)' FROM information_schema.TABLES GROUP BY table_schema") | |
$results3.each do |row3| | |
puts "#{row3['Database name']} #{row3['Size (MB)']}" | |
end | |
------ | |
Output | |
information_schema 0.878906E-2 | |
monitoring 0.174296875E3 | |
notification 0.140625E0 | |
----- | |
If I run it in mysql I get this | |
mysql> SELECT table_schema AS 'Database name', SUM(data_length + index_length) / 1024 / 1024 AS 'Size (MB)' FROM information_schema.TABLES GROUP BY table_schema; | |
+--------------------+--------------+ | |
| Database name | Size (MB) | | |
+--------------------+--------------+ | |
| information_schema | 0.00878906 | | |
| monitoring | 174.29687500 | | |
| notification | 0.14062500 | | |
+--------------------+--------------+ | |
-------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment