View the actual size and space of the MySQL data table

Source: Internet
Author: User

Select COUNT (*) from T1;

+----------+

| COUNT (*) |

+----------+

| 5 |

+----------+

SELECT table_name,

data_length/1024/1024 as ' data_length (MB) ',

index_length/1024/1024 as ' index_length (MB) ',

(Data_length + index_length)/1024/1024 as ' Total (MB) '

From Information_schema.tables

WHERE table_schema= ' Test '

and table_name = ' T1 ';

+------------+-----------------+------------------+------------+

| table_name | Data_length (MB) | Index_length (MB) | Total (MB) |

+------------+-----------------+------------------+------------+

|    T1 0.01562500 | 0.00000000 | 0.01562500 |

+------------+-----------------+------------------+------------+

It can be seen from the above that the size of the data on the disk is 12G, and the actual size is 0.01562500MB (estimate), in the case of the use of logical migration is no better.

Prevent false large tables from appearing.

This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1906244

View the actual size and space of the MySQL data table

Related Article

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.