List:Internals« Previous MessageNext Message »
From:Ingo Strüwing Date:December 8 2006 5:29pm
Subject:Re: erratum in the "MySQL Internals Manual"
View as plain text  
Hi,

Am Donnerstag, den 23.11.2006, 09:19 -0500 schrieb David Lee Lambert:
> Section 11.1.1. ("Introduction",  
> http://dev.mysql.com/doc/internals/en/myisam-introduction.html ) uses the 
> following example for a MyISAM dynamic row:
...

some time ago I started to write a page for the internals manual, but
had to switch to other tasks. Please see the attached file.

Regards,
Ingo
-- 
Ingo Strüwing, Senior Software Developer
MySQL AB, www.mysql.com

MyISAM Dynamic Data File Layout
===============================

1. Record storage frame
-----------------------

A sequence of 'parts'.
  MI_MIN_BLOCK_LENGTH	20
  MI_MAX_BLOCK_LENGTH   16777212
  MI_DYN_ALIGN_SIZE	4

Part header[0] (decimal/hexadecimal):

  0/00: Deleted block
        block_len 3 bytes [1-3]
        next_filepos 8 bytes [4-11]
        prev_filepos 8 bytes [12-19]
        header length 20

  1/01: Full small record, full block
        rec_len,data_len,block_len 2 bytes [1-2]
        header length 3

  2/02: Full big record, full block
        rec_len,data_len,block_len 3 bytes [1-3]
        header length 4

  3/03: Full small record, unused space
        rec_len,data_len 2 bytes [1-2]
        unused_len 1 byte [3]
        header length 4

  4/04: Full big record, unused space
        rec_len,data_len 3 bytes [1-3]
        unused_len 1 byte [4]
        header length 5

  5/05: Start small record
        rec_len 2 bytes [1-2]
        data_len,block_len 2 bytes [3-4]
        next_filepos 8 bytes [5-12]
        header length 13

  6/06: Start big record
        rec_len 3 bytes [1-3]
        data_len,block_len 3 bytes [4-6]
        next_filepos 8 bytes [7-14]
        header length 15

  7/07: End small record, full block
        data_len,block_len 2 bytes [1-2]
        header length 3

  8/08: End big record, full block
        data_len,block_len 3 bytes [1-3]
        header length 4

  9/09: End small record, unused space
        data_len 2 bytes [1-2]
        unused_len 1 byte [3]
        header length 4

 10/0A: End big record, unused space
        data_len 3 bytes [1-3]
        unused_len 1 byte [4]
        header length 5

 11/0B: Continue small record
        data_len,block_len 2 bytes [1-2]
        next_filepos 8 bytes [3-10]
        header length 11

 12/0C: Continue big record
        data_len,block_len 3 bytes [1-3]
        next_filepos 8 bytes [4-11]
        header length 12

 13/0D: Start giant record
        rec_len 4 bytes [1-4]
        data_len,block_len 3 bytes [5-7]
        next_filepos 8 bytes [8-15]
        header length 16


block_len does not include the header length except of deleted blocks.
In deleted blocks block_len includes the header length.

data_len is the number of bytes within this block that are part of
the record.

rec_len is the total record length including the data lengths of all
belonging blocks.

In deleted blocks next_filepos and prev_filepos make a doubly linked
list over all deleted blocks. At list start, prev_filepos is
HA_OFFSET_ERROR (all bits set). At list end, next_filepos is
HA_OFFSET_ERROR (all bits set).

In non-deleted blocks next_filepos points to the next part of the
record.

The read function for the block header of dynamic records is
mi_dynrec.c:_mi_get_block_info().


2. Record contents
------------------

-- to be added --


Thread
erratum in the "MySQL Internals Manual"David Lee Lambert23 Nov
  • Re: erratum in the "MySQL Internals Manual"Sergei Golubchik27 Nov
  • Re: erratum in the "MySQL Internals Manual"Ingo Strüwing8 Dec