Check the sizes of tables in the database! (1)eweer

Cover Image for Check the sizes of tables in the database! (1)eweer
Adou
Adou

This side handles some database size analysis

SELECT

table_schema AS 'table_schema',

sum(table_rows) AS 'table_rows',

sum(TRUNCATE (data_length / 1024 / 1024, 2)) AS 'data_length(MB)', sum(TRUNCATE (index_length / 1024 / 1024, 2)) AS 'index_length(MB)'

FROM

information_schema.tables

WHERE

table_schema = 'xxx';


select table_schema , table_name , table_rows, truncate(data_length/1024/1024, 2) as 'data_length(MB)', truncate(index_length/1024/1024, 2) as 'index_length(MB)' from information_schema.tables where table_schema='xxx' order by data_length desc, index_length desc;


More Stories

Cover Image for Check the sizes of table

Check the sizes of table

Check the sizes of tables in the database.

Adou
Adou
Cover Image for Check the sizes of tables in the database!

Check the sizes of tables in the database!

Check the sizes of tables in the database.

Adou
Adou