Data_length in show table status

I am trying to figure out the size of a database table. I ran a show table status request and I have the data_length parameter as a result. Does this mean the actual size of the database table?

+4
source share
1 answer

For InnoDB, data_length is an estimate of the size of the table in bytes, not counting secondary indexes. The documentation says that this is β€œdata file size”, but this language assumes that you have data in a separate file, which is not always the case with InnoDB.

The table size is a bit fuzzy for InnoDB, because InnoDB also saves several copies of rows around the world in the rollback segment, and there are other uses on disk (data dictionary, change buffer).

You should also add index_length , which is the size of the secondary indexes.

+4
source

Source: https://habr.com/ru/post/1491933/


All Articles