# HG changeset patch # User Oleksandr Gavenko # Date 1453493622 -7200 # Node ID 25c0fb1dfc227bb464fb1996fbb5680c7547c9e6 # Parent 7627e51556bfcf953a3cbf96234a933c6d46e6f9 DB sizes. diff -r 7627e51556bf -r 25c0fb1dfc22 mysql.rst --- 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;