DB sizes.
--- a/mysql.rst Fri Jan 22 22:10:18 2016 +0200
+++ b/mysql.rst Fri Jan 22 22:13:42 2016 +0200
@@ -66,19 +66,27 @@
MariaDB [mysql]> SHOW TABLE STATUS FROM mydb;
+::
+
SELECT
- table_schema as `Database`,
- table_name AS `Table`,
- round(((data_length + index_length) / 1024 / 1024), 2) `Size, MiB`
+ table_schema "Database",
+ ROUND(SUM(data_length+index_length)/1024/1024, 2) "Size, MiB"
+ FROM information_schema.TABLES
+ GROUP BY table_schema;
+
+ SELECT
+ table_schema as `Database`,
+ table_name AS `Table`,
+ round(((data_length + index_length) / 1024 / 1024), 2) `Size, MiB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC;
SELECT
- table_schema as `Database`,
- table_name AS `Table`,
- round((data_length / 1024 / 1024), 2) `Data, MiB`,
- round((index_length / 1024 / 1024), 2) `Index, MiB`,
- round(((data_length+index_length) / 1024 / 1024), 2) `Total, MiB`
+ table_schema as `Database`,
+ table_name AS `Table`,
+ round((data_length / 1024 / 1024), 2) `Data, MiB`,
+ round((index_length / 1024 / 1024), 2) `Index, MiB`,
+ round(((data_length+index_length) / 1024 / 1024), 2) `Total, MiB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC;