Home > database >  Consult a line of compact storage problem
Consult a line of compact storage problem

Time:09-27

Beginners mysql, a little confusion on a compact line store

Version 5.7.22

Build table below
The create table t3 (
Id varchar (5)
The name varchar (8)
To address a varchar (10)
, tel char (13)
, work varchar (20)
) engine=innodb row_format=compact;

The data shown in the following

Mysql> Select * from t3;
+ -- -- -- -- -- -- -- + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| | id name | address | tel | work |
+ -- -- -- -- -- -- -- + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| | 1 asd | China IT | | 808 |
11 | | QWEasdf | US | 3131 | SHOP |
33333 | | NULL | NULL | NULL | NULL |
9999999 | | 200 | | xyz UK | driver |
+ -- -- -- -- -- -- -- + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
4 rows in the set (0.00 SEC)


Question: in t3. Ibd table space view,


Blue box, and on behalf of the second row from the beginning of the c0ae, computing the next row header is the offset of 00 36 (red box), that started in the c0e4
But in fact the third line started with c0e8 (green box)
Why is this?
In the second row in the recording head offset should is 00 3 a, the second row occupies 58 bytes (5 + 1 + 5 + 6 + 6 + 7 + 28=58).
  • Related