Documentation Source Text

Check-in [88dc8a8a7b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the file-format document to show the page type header numbers on various charts, for ease of reference.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 88dc8a8a7b96f86805286d5f3a054da6b9df8d04
User & Date: drh 2015-05-23 17:48:17
Context
2015-05-26
12:26
Cherrypick several recent minor changes from trunk. check-in: 0f4cfe6cd0 user: drh tags: branch-3.8.10
2015-05-25
09:22
Fix typo in the "deprecated" footnote on the pragma list. check-in: 7555c435cc user: drh tags: trunk
2015-05-23
17:48
Enhance the file-format document to show the page type header numbers on various charts, for ease of reference. check-in: 88dc8a8a7b user: drh tags: trunk
02:44
Start the change log for 3.8.11. check-in: b189725f2c user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/fileformat2.in.

654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
...
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
are the more significant and bits taken from the later bytes. </p>

<p>The format of a cell depends on which kind of b-tree page the cell
appears on.  The following table shows the elements of a cell, in
order of appearance, for the various b-tree page types.</p>

<blockquote><dl>
<dt><p>Table B-Tree Leaf Cell:</p></dt>
<dd><p><ul>
<li>A varint which is the total number of bytes of payload, including any
overflow
<li>A varint which is the integer key, a.k.a. "[rowid]"
<li>The initial portion of the payload that does not spill to overflow
pages.
<li>A 4-byte big-endian integer page number for the first page of the
overflow page list - omitted if all payload fits on the b-tree page.
</ul></p></dd>

<dt><p>Table B-Tree Interior Cell:</p></dt>
<dd><p><ul>
<li>A 4-byte big-endian page number which is the left child pointer.
<li>A varint which is the integer key
</ul></p></dd>

<dt><p>Index B-Tree Leaf Cell:</p></dt>
<dd><p><ul>
<li>A varint which is the total number of bytes of key payload, including any
overflow
<li>The initial portion of the payload that does not spill to overflow
pages.
<li>A 4-byte big-endian integer page number for the first page of the
overflow page list - omitted if all payload fits on the b-tree page.
</ul></p></dd>

<dt><p>Index B-Tree Interior Cell:</p></dt>
<dd><p><ul>
<li>A 4-byte big-endianpage number which is the left child pointer.
<li>A varint which is the total number of bytes of key payload, including any
overflow
<li>The initial portion of the payload that does not spill to overflow
pages.
<li>A 4-byte big-endian integer page number for the first page of the
................................................................................
<tcl>hd_fragment cellformat {cell format summary}</tcl>
<center>
<i>B-tree Cell Format</i>
<table border=1 width="80%">
<tr><th rowspan=2>Datatype
    <th colspan=4>Appears in...
    <th rowspan=2>Description
<tr><th>Table Leaf
    <th>Table Interior
    <th>Index Leaf
    <th>Index Interior
<tr><td align=center valign=top>4-byte integer
    <td align=center valign=top>&nbsp;
    <td align=center valign=top>&#x2714;
    <td align=center valign=top>&nbsp;
    <td align=center valign=top>&#x2714;
    <td align=left>Page number of left child
<tr><td align=center valign=top>varint







|










|





|









|







 







|
|
|
|







654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
...
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
are the more significant and bits taken from the later bytes. </p>

<p>The format of a cell depends on which kind of b-tree page the cell
appears on.  The following table shows the elements of a cell, in
order of appearance, for the various b-tree page types.</p>

<blockquote><dl>
<dt><p>Table B-Tree Leaf Cell (header 0x0d):</p></dt>
<dd><p><ul>
<li>A varint which is the total number of bytes of payload, including any
overflow
<li>A varint which is the integer key, a.k.a. "[rowid]"
<li>The initial portion of the payload that does not spill to overflow
pages.
<li>A 4-byte big-endian integer page number for the first page of the
overflow page list - omitted if all payload fits on the b-tree page.
</ul></p></dd>

<dt><p>Table B-Tree Interior Cell (header 0x05):</p></dt>
<dd><p><ul>
<li>A 4-byte big-endian page number which is the left child pointer.
<li>A varint which is the integer key
</ul></p></dd>

<dt><p>Index B-Tree Leaf Cell (header 0x0a):</p></dt>
<dd><p><ul>
<li>A varint which is the total number of bytes of key payload, including any
overflow
<li>The initial portion of the payload that does not spill to overflow
pages.
<li>A 4-byte big-endian integer page number for the first page of the
overflow page list - omitted if all payload fits on the b-tree page.
</ul></p></dd>

<dt><p>Index B-Tree Interior Cell (header 0x02):</p></dt>
<dd><p><ul>
<li>A 4-byte big-endianpage number which is the left child pointer.
<li>A varint which is the total number of bytes of key payload, including any
overflow
<li>The initial portion of the payload that does not spill to overflow
pages.
<li>A 4-byte big-endian integer page number for the first page of the
................................................................................
<tcl>hd_fragment cellformat {cell format summary}</tcl>
<center>
<i>B-tree Cell Format</i>
<table border=1 width="80%">
<tr><th rowspan=2>Datatype
    <th colspan=4>Appears in...
    <th rowspan=2>Description
<tr><th>Table Leaf (0x0d)
    <th>Table Interior (0x05)
    <th>Index Leaf (0x0a)
    <th>Index Interior (0x02)
<tr><td align=center valign=top>4-byte integer
    <td align=center valign=top>&nbsp;
    <td align=center valign=top>&#x2714;
    <td align=center valign=top>&nbsp;
    <td align=center valign=top>&#x2714;
    <td align=left>Page number of left child
<tr><td align=center valign=top>varint