How does MySQL calculate the table size?

Source: Internet
Author: User

How does MySQL calculate the table size?

@ Forandever 2011-11-11

Use SQL statements:

Show table status from dbname where name = 'tbname' and update_time> 20111111;

Returned array:
Name: tbname table name
Engine: MyISAM | InnoDB (Table store engine)
Version: Version X
Row_format: Row format
Rows: Total number of rows in the table
Avg_row_length: Average size of each row
Data_length: the total size of the data file in bytes.
Max_data_length: Maximum length of the data file. If the storage engine is InnoDB, the value displayed in show table status is always 0.
Index_length: Index size
Data_free: the number of bytes in an integer but not in use.
Auto_increment: auto-increment ID, next auto_increment Value
Create_time: Table Creation Time
Update_time: The Last Update Time of the data file.
Check_time: The last time the table was checked. Not all storage engines are updated at this time. In this case, the value is null.
Collation: Encoding
Checksum:
Create_options: row_format = dynamic, which is used together with CREATE TABLE
Comment: Comment

Database size = table structure + Table Data + Index = data_length + index_length

@ Forever 2011-11-11

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.