MySQL Forums
Forum List  »  InnoDB

Difference between theoretical and real storage size
Posted by: Leo Kotschenreuther
Date: May 18, 2013 03:38AM

Hi,

I'm wondering, where the difference between theoretical und real storage is coming from:

For example: I have one table with only one row.
The table has one integer-attribute (primary key) and ten VarChar(45) Attributes.
In theoretical the size needed for the table would be the size of the integer and the size of the ten VarChar(45), as there is only one row.
This would be: 4 Byte + 10 * (45Byte + 1 Byte) = 464 Bytes

(The one extra Byte per VarChar is explained in the MySQL Reference about Data Types)

If I run the following query, it says, that the size of the table is 466 Bytes:
SELECT table_name AS 'Table', data_length 'Size' FROM information_schema.TABLES WHERE table_schema = 'inheritance' AND table_name = 'testtable'

Does anyone know, where the two extra Bytes are coming from?

I think this could be Meta-Data, the two Bytes could be pointers to the beginning of the row.
Is there a reference about this?

Thanks for your help

Options: ReplyQuote


Subject
Views
Written By
Posted
Difference between theoretical and real storage size
1518
May 18, 2013 03:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.