根节点和叶节点的创建

当创建空表的索引时,数据库服务器分配一个索引页。该页代表根节点并保留为空,直到在该表中插入数据。

起初,根节点以与叶节点相同的方式发挥功能。对于插入表中的每一行,数据库服务器在根节点中创建并插入索引项。图 1 说明了根节点在其填充之前是什么样的。

图: 根节点


begin figure description - The figure shows a table inside of root node one; the contains two columns; the first column is a list of names, the second column contains rowid information for each name in the corresponding row. end figure description
当根节点的索引项被填满时,数据库服务器通过以下步骤分割根节点:

当您将新行添加到表中时,数据库服务器将索引项添加到叶节点中。当叶节点填满时,数据库服务器创建新的叶节点,将已满索引节点的一部分内容移动到新节点中,并在根节点中添加指向新节点的节点指针,

例如:假如 图 2 图中的叶节点 3 已满。当发生这种情况时,数据库服务器添加另一个叶节点。数据库服务器从叶节点 3 将一部分记录移动至新的叶节点中,如图 图 2 所示。

图: 在叶节点 3 填满后创建叶节点 4


begin figure description - The paragraph that precedes this figure describes the content of the figure. - end figure description