View the database table space. MD

Source: Internet
Author: User

To view the size of the data footprint:

SELECT CONCAT(ROUND(SUM(data_length)/(1024*1024*1024), 6), ‘ GB‘) AS ‘Total Data Size‘  FROM information_schema.TABLES WHERE table_schema LIKE ‘quizzes‘;

To view the space under the specified database schema:

select TABLE_NAME, concat(truncate(data_length/1024/1024,2),‘ MB‘) as data_size, concat(truncate(index_length/1024/1024,2),‘ MB‘) as index_size from information_schema.tables where TABLE_SCHEMA = ‘quizzes‘;SELECT CONCAT(table_schema,‘.‘,table_name) AS ‘Table Name‘,  table_rows AS ‘Number of Rows‘,  CONCAT(ROUND(data_length/(1024*1024*1024),6),‘ G‘) AS ‘Data Size‘,  CONCAT(ROUND(index_length/(1024*1024*1024),6),‘ G‘) AS ‘Index Size‘ ,  CONCAT(ROUND((data_length+index_length)/(1024*1024*1024),6),‘ G‘) AS‘Total‘ FROM information_schema.TABLES  WHERE table_schema LIKE ‘aries_account‘ order by Total;

View the space for all schemas under this instance:

select table_schema, sum(data_length+index_length)/1024/1024 as total_mb,   sum(data_length)/1024/1024 as data_mb, sum(index_length)/1024/1024 as index_mb,   count(*) as tables, curdate() as today from information_schema.tables group by table_schema order by 2 desc;select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,  concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,   concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,  concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size  from information_schema.tables;

View the database table space. MD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.