1 / 14

Indexing (cont.)

Indexing (cont.). Insertion in a B+ Tree. Another B+ Tree. 10. 15. 18. 19. 20. 25. 30. 40. 50. 60. 65. 80. 85. 90. Insertion in a B+ Tree. Now Insert 12. 10. 15. 18. 19. 20. 25. 30. 40. 50. 60. 65. 80. 85. 90. Insertion in a B+ Tree. Need to split leaf. 10. 12.

Download Presentation

Indexing (cont.)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Indexing (cont.)

  2. Insertion in a B+ Tree Another B+ Tree 10 15 18 19 20 25 30 40 50 60 65 80 85 90

  3. Insertion in a B+ Tree Now Insert 12 10 15 18 19 20 25 30 40 50 60 65 80 85 90

  4. Insertion in a B+ Tree Need to split leaf 10 12 15 18 19 20 25 30 40 50

  5. Insertion in a B+ Tree Need to split branch 10 12 15 18 19 20 25 30 40 50

  6. Insertion in a B+ Tree After split 10 12 15 18 19 20 25 30 40 50

  7. Deleting a Data Entry from a B+ Tree • Start at root, find leaf L where entry belongs. • Remove the entry. • If L is at least half-full, done! • If L has only d-1 entries, • Try to re-distribute, borrowing from sibling (adjacent node with same parent as L). • If re-distribution fails, mergeL and sibling. • If merge occurred, must delete entry (pointing to L or sibling) from parent of L. • Merge could propagate to root, decreasing height.

  8. Deletion from a B+ Tree Delete 30 10 15 18 19 20 25 30 40 50 60 65 80 85 90

  9. Deletion from a B+ Tree After deleting 30 May change to 40, or not 10 15 18 19 20 25 40 50 60 65 80 85 90

  10. Deletion from a B+ Tree Now delete 25 10 15 18 19 20 25 40 50 60 65 80 85 90

  11. Deletion from a B+ Tree After deleting 25 Need to rebalance Rotate 10 15 18 19 20 40 50 60 65 80 85 90

  12. Deletion from a B+ Tree Now delete 40 10 15 18 19 20 40 50 60 65 80 85 90

  13. Deletion from a B+ Tree After deleting 40 Rotation not possible Need to merge nodes 10 15 18 19 20 50 60 65 80 85 90

  14. Deletion from a B+ Tree Final tree 10 15 18 19 20 50 60 65 80 85 90

More Related