
System Architecture 2-135
Structure of an Index Page
The byte partof the indexkey value isas long asneeded to containthe value
of the index key. If the indexed data is a VARCHAR data type, the calculated
length ofthe index key is the maximum length plus1. The additional byte is
a required-length byte, which precedes the VARCHAR data when it is stored
in the database. Therefore, the maximum VARCHAR that can be indexed is
254 bytes.
As an example of an index key value, consider row 101 in the table
stores5:customer. Thelname valueof row 101 is Pauli. The index key value
for this lname value is composed of a byte entry, Pauli, and a 4-byte rowid
entry for data row 101.
If twoor more rows share thesame lname value, the rowid part of the index
keyvalueisa list of rowidsforrowsthatsharethiskey value. In thisway,the
bytes part remains unique within the index. Figure 2-32 illustrates the
concept of the index key value.
When the first row of data is inserted into a table, the root node index page
receives one index key value and one 2-byte slot table entry. The root node
page serves as a leaf node page until it becomes full.
Figure 2-32
Index key
values contain two
parts: a byte part
and one or more
rowids.
Index key values
rowid
rowid rowid
bytes
bytes
n 3
0
3 07n
Comentários a estes Manuais