21.1.1.2 EXTRA BYTES

The Extra Bytes are a fixed six-byte header.

Name

Size

Description

info_bits:

??

??

()

1 bit

unused or unknown

()

1 bit

unused or unknown

deleted_flag

1 bit

1 if record is deleted

min_rec_flag

1 bit

1 if record is predefined minimum record

n_owned

4 bits

number of records owned by this record

heap_no

13 bits

record's order number in heap of index page

n_fields

10 bits

number of fields in this record, 1 to 1023

1byte_offs_flag

1 bit

1 if each Field Start Offsets is 1 byte long (this item is also called the "short" flag)

next 16 bits

16 bits

pointer to next record in page

TOTAL

48 bits

??

Total size is 48 bits, which is six bytes.

If you're just trying to read the record, the key bit in the Extra Bytes is 1byte_offs_flag — you need to know if 1byte_offs_flag is 1 (that is, "short 1-byteoffsets") or 0 (that is, "2-byte offsets").

Given a pointer to the Origin, InnoDB finds the start of the record as follows:

  • Let X = n_fields (the number of fields is by definition equal to the number of entries in the Field Start Offsets Table).

  • If 1byte_offs_flag equals 0, then let X = X * 2 because there are two bytes for each entry instead of just one.

  • Let X = X + 6, because the fixed size of Extra Bytes is 6.

  • The start of the record is at (pointer value minus X).


User Comments
Sign Up Login You must be logged in to post a comment.