tailieunhanh - Database Management systems phần 4
Nhập cảnh sẽ được chèn vào trong nút cha. (Lưu ý rằng 5 là 'sao chép' và tiếp tục xuất hiện trong lá. Nhập cảnh sẽ được chèn vào trong nút cha. (Lưu ý rằng 17 là "bị đẩy lên và và xuất hiện một lần trong chỉ số này tương phản với một sự chia rẽ lá.) Chia trang Index trong Insert of Entry 8 | Tree-Structured Indexing 259 Figure Split Leaf Pages during Insert of Entry 8 Figure Split Index Pages during Insert of Entry 8 Now since the split node was the old root we need to create a new root node to hold the entry that distinguishes the two split index pages. The tree after completing the insertion of the entry 8 is shown in Figure . Figure B Tree after Inserting Entry 8 One variation of the insert algorithm tries to redistribute entries of a node N with a sibling before splitting the node this improves average occupancy. The sibling of a node N in this context is a node that is immediately to the left or right of N and has the same parent as N. To illustrate redistribution reconsider insertion of entry 8 into the tree shown in Figure . The entry belongs in the left-most leaf which is full. However the only 260 Chapter 9 sibling of this leaf node contains only two entries and can thus accommodate more entries. We can therefore handle the insertion of 8 with a redistribution. Note how the entry in the parent node that points to the second leaf has a new key value we copy up the new low key value on the second leaf. This process is illustrated in Figure . Root Figure B Tree after Inserting Entry 8 Using Redistribution To determine whether redistribution is possible we have to retrieve the sibling. If the sibling happens to be full we have to split the node anyway. On average checking whether redistribution is possible increases I O for index node splits especially if we check both siblings. Checking whether redistribution is possible may reduce I O if the redistribution succeeds whereas a split propagates up the tree but this case is very infrequent. If the file is growing average occupancy will probably not be affected much even if we do not redistribute. Taking these considerations into account not redistributing entries at non-leaf levels usually pays off. If a split occurs at the leaf level however we have to retrieve a .
đang nạp các trang xem trước