SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)

Understanding and Planning SQL/MX Tables
HP NonStop SQL/MX Installation and Management Guide523723-004
4-7
Key-Sequenced Tree Structure
Figure 4-1 illustrates a sample tree structure for a key-sequenced file.
Each data block contains a header plus one or more data records, depending on the
record size and data-block size. For each data block, an entry in an index block
contains the value of the key field for the first record in the data block and the address
of that data block.
The position of a new record inserted into a key-sequenced file is determined by the
value of its clustering key field. If the data block is determined to be full when NonStop
SQL/MX attempts to insert a new record into it, a block split occurs: the disk process
allocates a new data block, moves part of the data from the old block into the new
Figure 4-1. Key-Sequenced B-Tree Structure
Saved
for future
insertions
First (Highest)-Level Index Block
Second-Level Index Block
Data Blocks
Second-Level Index Block
MOLLY
MOLLY NATE
Data Record
Primary Key
Legend
1
2
VST002.vsd
Variable-length
physical records
OLGA RUSTY Empty
STEVE
ULENA Empty
Empty
AMY
BETTY
Empty
CAROL CHRIS Empty
LOUISE MILLY Empty
OLGA
STEVE
0
CAROL LOUISE
0 MOLLY VINCE
NATE is alphabetically greater than MOLLY but less than VINCE.
Go to the second-level index block that begins with MOLLY.
1
NATE is alphabetically greater than MOLLY but less than OLGA.
Go to the data block that begins with MOLLY.
2