1 / 26

High-Concurrency Locking in R-Trees

High-Concurrency Locking in R-Trees. Marcel Kornacker Universität Hamburg. Douglas Banks University of California at Berkeley. VLDB 1995. Presented by: Robertas Kerpys. November 11, 2010. Motivation. Query. p16. p10. p15. p14. p4. p5. p6. p7. p8. p9. p13. p11. p1. p2.

geri
Télécharger la présentation

High-Concurrency Locking in R-Trees

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. High-Concurrency Locking inR-Trees Marcel KornackerUniversität Hamburg Douglas Banks University of California at Berkeley VLDB 1995 Presented by: Robertas Kerpys November 11, 2010

  2. Motivation Query p16 p10 p15 p14 p4 p5 p6 p7 p8 p9 p13 p11 p1 p2 p3 p12 R2 p16 R1 R6 R5 R3 R7 R4 Database Specialization Course

  3. Motivation Query p16 p10 p15 p14 p4 p5 p6 p7 p8 p9 p13 p11 p1 p2 p3 p12 R2 p16 R1 R6 R5 R3 R7 R4 Database Specialization Course

  4. Motivation Query p16 p10 p15 p14 p13 p4 p5 p6 p7 p8 p9 p11 p1 p2 p3 p12 R2 R1 R6 R5 R3 R8 R7 R4 Database Specialization Course

  5. Motivation • Concurrency requires special handling of the index structure to ensure consistency • Many of the methods which offers concurrent tree traversal employ top-down lock-coupling • Main goal is to enable queries and updates execute concurrently while ensuring the correctness of the results Database Specialization Course

  6. Overview • Motivation • B-link tree • R-link tree • Algorithms (Search, Insert, Delete) • Empirical study • Conclusion • Critique Database Specialization Course

  7. Blink - tree Database Specialization Course

  8. Obstacles p10 p13 p8 p7 p6 p5 p9 p4 p11 p1 p2 p3 p12 • The main difficulty is that R-tree does not have a linear ordering • Keys cannot conclusively tell us when a node has split R2 R1 R6 R5 R3 Database Specialization Course R7 R4

  9. How to adapt links on an R-tree? • System of sequence numbers is introduced to determine when and how to traverse sibling links Database Specialization Course

  10. Structure of an R-link tree p1 p2 z w y x 4 2 5 1 c1 c2 c3 c4 c5 5 6 4 2 1 Database Specialization Course

  11. Search Stack x y w z Qualifyingentries: y z w x 1 2 4 5 p1 p2 c3 c5 c2 c1 c2 c3 c4 c5 5 6 4 2 1 Database Specialization Course

  12. Insertion insert(Rect r): stack = findLeaf(root, r, root-lsn) leaf = pop(stack) insert r on leaf if leaf was split extendParent(leaf, leaf.MBR, leaf.LSN, right_sibling, right_sibling.MBR, right_sibling.LSN, stack) else if bounding-rect of leaf changed updateParent(leaf, leaf.MBR, stack) else w-unlock(leaf) Database Specialization Course

  13. Insertion. Find Leaf findLeaf(root, r, root-lsn) - exclusive lock - shared lock Stack: N N N1 N1 N2 N3 N4 N4 N5 N6 N7 Database Specialization Course

  14. Insertion. Extend Parent extendParent - exclusive lock - shared lock Stack: N N1 N N1 N2 R8 N3 N8 N4 N5 N6 N7 Database Specialization Course

  15. Deletion • A combination of the search and insert algorithms • Nodes are removed as soon as they become empty • In order to not employ the lock-coupling when descending the tree we have to take care of invalid pointers when removing nodes • A tree-global generation counter (TGC) is introduced Database Specialization Course

  16. Deletion TGC N N1 N2 R8 N3 N4 N5 N6 N7 p1 p2 p3 p4 N = 9 N4 = 10 N4 = 9 N1 = 9 N5 = 9 10 9 N2 = 9 N6 = 9 N3 = 9 N7 = 9 Database Specialization Course

  17. Overview • Motivation • B-link tree • R-link tree • Algorithms (Search, Insert, Delete) • Empirical study • Conclusion • Critique Database Specialization Course

  18. Experimental Setup • R-tree implementation employs a variation of Bayer-Schkolnick-style lock-coupling for concurrent insertions • Three different workloads: • The low-contention workload consists of a varying number of searchers and a single inserter • The moderate-contention workload of inserters only • The high-contention workload of an equal number of searchers and inserters • The index was pre-loaded with 30600 2-dimensional non-overlapping rectangles Database Specialization Course

  19. Empirical Evaluation Database Specialization Course

  20. Empirical Evaluation (cont.) Database Specialization Course

  21. Related Work • Blink – tree “Efficient Locking for Concurrent Operations on B-trees” by Philip L. Lehman, S. Bing Yao • Applied on B-trees • All ideas are drawn from this paper Database Specialization Course

  22. Conclusion • R-link trees look and work similar to B-link trees • Holds only a few locks at one time • Descending an R-link tree to a leaf requires no lock-coupling Database Specialization Course

  23. Critique. Advantages • Recovery is addressed • R-link tree was implemented for commercial database • Examples were good and where needed Database Specialization Course

  24. Critique. Disadvantages • Workload is to small (30600 rectangles which does not even overlap) • Authors review only papers for concurrency in B-trees • They did not implemented everything they talked about • The notation in pseudo-code is not introduced in the text thus it was not obvious right away e.g. r-lock Database Specialization Course

  25. Thank you! Database Specialization Course

  26. Questions?Spørgsmål?Întrebare? Klausimai? Database Specialization Course

More Related