mysql record (Record)

The following comes from the "mysql kernel: Innodb Storage Engine Volume 1"
brief physical records and big record. This section only understand mysql index underlying storage structure and write.

mysql default storage engine is Innodb. Innodb smallest unit is managed on the disk page (page), each page in turn line recording storage.
Row (Row) and record (Record) are equivalent, the recording is the row, the row is recorded. In the relational data theory, called the record again tuple (tuple). Between the rows and the tuples are equivalent, in the book, the record as a physical row, tuples as logical records, it is known to store computer data in a binary manner, the behavior of binary data, and logically compared tuple data.


Physical record

Physical record two-part:
1. Extra info: col list and is divided into record header.
2. The actual storage line.

Write pictures described here

col list: flashback memory column address, whether the null, whether the external memory contains the attributes (extern)
Record header: a recording head

  • n_owned: page directory groove sparse employed method, not a record corresponding to one slot, but a slot corresponding to one record, and this represents the number of recorded n_owned attribute records owned by the record.
  • head no:
    1. Data representing the sequence numbers among the stack, through the associated record next record. Is a single chain structure can be seen between the record.
    2. Between the record physically sorted according to the insertion time, not in accordance with the continuous primary key value, thus reducing the cost of the deletions, but by primary key values ​​in a logically contiguous.
    3. head no as well as for row lock function.

Line: after the record header is actually stored content.

Write pictures described here

Big Data page

A page size is 16K, the presence of rows of data page, when faced with text, blob that large text, it is likely a field value is more than the 16k. That Innodb is how to do it?

The original data is stored not only on the current page, When the amount of data exceeds the range will be stored on overflow pages. Properties of this column is extern.

Range
1. The total number of bytes is greater than page_get_free_space_of_empty * 1/2 () (8132 bytes);
2. column is greater than REC_MAX_DATA_SIZE (16k)

Original Address: https://blog.csdn.net/d57893269/article/details/53907974

Guess you like

Origin www.cnblogs.com/jpfss/p/11425043.html
Recommended