1 / 41

R-Trees A Dynamic Index Structure for Spatial Searching

R-Trees A Dynamic Index Structure for Spatial Searching. Antonin Guttman In Proceedings of the 1984 ACM SIGMOD international conference on Management of data (SIGMOD '84). ACM, New York, NY, USA. Outline. Introduction R-Tree Index Structure Searching and Updating Performance Tests

erica
Télécharger la présentation

R-Trees A Dynamic Index Structure for Spatial Searching

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. R-Trees A Dynamic Index Structure for Spatial Searching Antonin Guttman In Proceedings of the 1984 ACM SIGMOD international conference on Management of data (SIGMOD '84). ACM, New York, NY, USA

  2. Outline • Introduction • R-Tree Index Structure • Searching and Updating • Performance Tests • Conclusion

  3. Outline • Introduction • Background • Previous Works • R-Tree Index Structure • Searching and Updating • Performance Tests • Conclusion

  4. Background • Motivation • To deal with spatial data efficiently • Traditional database are for one-dimension data • Traditional Index Structure • Hash Tables • B Trees and ISAM

  5. Previous Works

  6. Outline • Introduction • R-Tree Index Structure • R-Tree Index Structure • Properties of the R-Tree • Example of a R-Tree • Searching and Updating • Performance Tests • Conclusion

  7. R-Tree Index Structure • What is a R-tree • Height-balanced tree similar to a B-tree • No need for doing periodic reorganization • What is the contents in the nodes • (I, tuple-identifier) in leaf node • (I, child-pointer) in non-leaf node • It must satisfy following properties

  8. Properties of the R-Tree • Let M be the maximum number of entries that will fit in one node • Let m <= M/2 be a parameter specifying the minimum number of entries in a node

  9. Properties of the R-Tree • Every leaf node contains between m and M index records unless it is the root • For each index record(I, tuple-identifier) in a leaf node, I is the smallest rectangle that spatially contains the n-dimensional data object represented by the indicated tuple • Every non-leaf node has between m and M children unless it is the root • For each entry(I, child-pointer) in a non-leaf node, I is the smallest rectangle that spatially contains the rectangles in the child node • The root node has at least two children unless it is a leaf • All leaves appear on the same level

  10. Example of a R-Tree

  11. Outline • Introduction • R-Tree Index Structure • Searching and Updating • Searching • Example of Searching • Insertion • Updates and Other Operations • Node Splitting • Performance Tests • Conclusion

  12. Searching • Problem definition Give an R-Tree whose root node is T, find all index records whose rectangles overlap a search rectangle S • Notations EI is the rectangle part of an index entry E Ep is the tuple-identifier or child-pointer of an E

  13. Searching Search(T, LIST) { IF (T is not a leaf) FOR EACH (E in T) IF (E.EI overlaps S) Search(E.Ep); ELSE FOR EACH (E in T) IF (E.EI overlaps S) LIST.ADD(E.Ep); }

  14. Example of Searching

  15. Insertion • It is similar to insert a record in B-treethat new record are added to the leaves, nodes that overflow are split, and splits propagate up the tree Insert(T, E) { L = ChooseLeaf(T, E); INSTALL E; IF (L is full) { LL = SplitNode(L); AdjustTree(L, LL); } }

  16. Insertion - ChooseLeaf() N ChooseLeaf(T, E) { SET N = T; IF (N is a non-leaf node) { find the F that F.FI needs least enlargement to include E.EI IN N SET N = F.Fp; ChooseLeaf(N, E); } ELSE return N; }

  17. Insertion - AdjustTree() AdjustTree(L, LL) { SET N = L; SET NN = LL; IF (N is root) // check if done return; SET P = N.parent; SET En to be N’s entry in P ADJUST EnI so that it tightly encloses all entry rectangles in N IF (NN != NULL) { CREATE Enn; // Enn.p = NN, EnnI enclosing all rectangles in NN P.add(Enn); IF (P is full) { PP = SplitNode(P); AdjustTree(P, PP); } } } These three lines are for adjust covering rectangle in parent entry

  18. Deletion • Remove index record E from an R-tree Delete(T, E) { L = FindLeaf(T, E); IF (L != NULL) { Remove(E, L); // remove E from L CondenseTree(L); IF (root node has only one child) make the child the new root; } }

  19. Deletion - FindLeaf() • Given an R-tree whose root node is T, find the leaf node containing the index entry E T FindLeaf(T, E) { IF (T is not a leaf) { FOR EACH (F in T) { IF (FI overlaps EI) { T = FindLeaf(Fp, E); } } } IF (T is leaf) { FOR EACH (F in T) IF (F MATCH E) return T; } }

  20. Deletion - CondenseTree() CondenseTree(L) { CT1: SET N = L; SET Q = empty; // the set of eliminated nodes. CT2: IF (N is root) { FOR EACH (E in Q) Insert(T, E); } ELSE { SET P = N.parent; SET En to be N’s entry in P; CT3: IF (N has fewer than m entries) { DELETE (En, P) // delete En from P Q.add(N); } ELSE { CT4: adjust EnI to tightly contain all entries in N; CT5: SET N = P; GOTO CT2; } } }

  21. Updates and Other Operations • Update • Just perform deletion and re-insertion to do update • Other operations • To find all data objects completely contained in a search area, or all objects that contain a search area • Range deletion

  22. Node Splitting • We need to perform node splitting when we insert an entry into a full node • The two covering rectangles after a split should be minimized because it affect efficiency seriously • The are three different kind of splitting algorithms: exhaustive algorithm, quadratic-cost algorithm and linear-cost algoritym

  23. Node Splitting- Exhaustive Algorithm • It is the most straightforward approach • To generate all possible groupings and choose the best • It most disadvantage is the high time complexity , and reasonable value of M is 200(4096/4/(4+1))

  24. Node Splitting - Quadratic-Cost Algorithm • It attempts to find a small-area split, but is not guaranteed to find one with the smallest area possible • The cost is quadratic in M and linear in the number of dimensions • Process • Pick first entry for each group • Check if done • Select entry to assign

  25. Quadratic-Cost Algorithm PickSeeds() • Select two entries to be the first elements of the groups • Process • Calculate inefficiency of grouping entries together • Choose the most wasteful pair

  26. Quadratic-Cost Algorithm PickNext() • Select one remaining entry for classification in a group • Process • Determine cost of putting each entry in each group • Find entry with greatest preference for one group

  27. Node Splitting – Linear-Cost Algorithm • It is linear in M and in the number of dimensions • It is identical to Quadratic Split but used a different version of PickSeed, PickNext • Process • Find extreme rectangles along all dimensions • Adjust for shape of the rectangle cluster • Select the most extreme pair

  28. Outline • Introduction • R-Tree Index Structure • Searching and Updating • Performance Tests • Performance Tests • CPU Cost of Inserting Records • CPU Cost of Deleting Records • Search Performance Pages Touched • Search Performance CPU Cost • Space Efficiency • Second Series of Tests • CPU Cost of Inserts and Deletes vs. Amount of Data • Search Performance vs. Amount of Data Pages Touched • Search Performance vs. Amount of Data CPU Cost • Space Required for R-Tree vs. Amount of Data • Conclusion

  29. Performance Tests • Implemented R-trees in C under Unix on a Vax 11/780 computer • It purpose is to choose values for M and m, and to evaluate different node-splitting algorithms • Five page sizes were tested, corresponding to different values of M • Values tested for m were M/2, M/3 and 2 • All tests used two-dimensional data

  30. CPU Cost of Inserting Records

  31. CPU Cost of Deleting Records

  32. Search Performance Pages Touched

  33. Search Performance CPU Cost

  34. Space Efficiency

  35. Second Series of Tests • It measured T-tree performance as a function of the amount of data in the index • The same sequence of test operations as before was run on samples containing 1057, 2238, 3295, and 4559 rectangles • Parameters • Linear algorithm with m = 2 • Quadratic algorithm with m = M/3 • Both with a page size of 1024 bytes(M=50)

  36. CPU Cost of Inserts and Deletes vs. Amount of Data

  37. Search Performance vs. Amount of Data Pages Touched

  38. Search Performance vs.Amount of Data CPU Cost

  39. Space Required for R-Tree vs. Amount of Data

  40. Outline • Introduction • R-Tree Index Structure • Searching and Updating • Performance Tests • Conclusion

  41. Conclusion • Author proposed an useful index structure, named R-tree, for multi-dimensional data • Author also gave tree different splitting algorithm, ran some tests on it, and concluded that linear node-split algorithm is the most efficient approach • R-tree would be easy to add to any relational database system

More Related