Title: RTrees: A Dynamic Index Structure For Spatial Searching
1R-Trees A Dynamic Index Structure For Spatial
Searching
CSED700 - Advanced Topics in Data Management
- Antonin Guttman
- Presented by Gae-won You
2Introduction
- R-Tree
- A multi-dimensional index structure
- A height balanced tree like the B-Tree
- Used widely in spatial and multimedia databases
3R-Tree Structure
M maximum number of entries m minimum number
of entries ( M/2)
R2
R1
- Every leaf node contains between m and M index
records unless it is the root. - Each leaf node has the smallest rectangle that
spatially contains the n-dimensional data
objects. - Every non-leaf node has between m and M children
unless it is the root. - Each non-leaf node has 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.
R3
A
B
ltMBR, Pointer to a child nodegt
ltMBR, Pointer to a spatial objectgt
4Search and Update
- Search
- Update
- Insertion
- Deletion
- Node Split (with Insertion)
- A Quadratic-Cost Algorithm
- A Linear-Cost Algorithm
5Search and Update
- Search
- Update
- Insertion
- Deletion
- Node Split (with Insertion)
- A Quadratic-Cost Algorithm
- A Linear-Cost Algorithm
6R-Tree Search (1/7)
R2
Find all objects whose rectangles are overlapped
with a search rectangle S
R1
R3
A
B
S
7R-Tree Search (2/7)
R2
R1
R3
A
B
S
8R-Tree Search (3/7)
R2
R1
R3
A
B
S
9R-Tree Search (4/7)
R2
R1
R3
A
B
S
10R-Tree Search (5/7)
R2
R1
R3
A
B
S
11R-Tree Search (6/7)
R2
R1
R3
A
B
S
12R-Tree Search (7/7)
R1
R3
A
B
S
B and D ? overlapped objects with S
13Search and Update
- Search
- Update
- Insertion
- Deletion
- Node Split (with Insertion)
- A Quadratic-Cost Algorithm
- A Linear-Cost Algorithm
14R-Tree Insertion (1/7)
R2
Insert a new spatial object X
R1
R3
A
B
X
15R-Tree Insertion (2/7)
R2
Find the proper child node - least enlargement
- smallest MBR if child nodes contains a
new object
R1
R3
A
B
X
16R-Tree Insertion (3/7)
R2
R1
R3
A
B
X
17R-Tree Insertion (4/7)
A
B
X
18R-Tree Insertion (5/7)
R2
R1
R3
A
B
R4
X
E
D
F
19R-Tree Insertion (6/7)
A
B
X
20R-Tree Insertion (7/7)
Empty Spot
21Search and Update
- Search
- Update
- Insertion
- Deletion
- Node Split (with Insertion)
- A Quadratic-Cost Algorithm
- A Linear-Cost Algorithm
22R-Tree Deletion
- Performed unlike a B-Tree deletion
- eliminate the node if it has too few entries (
m) - propagate node elimination upward as necessary
- re-insert its entries using insertion method
- re-insertion
- (1) easier to implement
- (2) prevent gradual deterioration
23Search and Update
- Search
- Update
- Insertion
- Deletion
- Node Split (with Insertion)
- A Quadratic-Cost Algorithm
- A Linear-Cost Algorithm
24Split with insertion
Y
R4
R4
?
E
F
D
Y
25Split
- The bad split may cause multiple paths for
searching
A
A
VS.
B
B
E
E
F
F
? Minimize the total area of the two covering
rectangles
26Quadratic split
- Divide S into S1 and S2
- Initial step choose two candidates
- Choose max MBR(a,b) area(a) area(b) for
all a, b - Iteration step
- Choose max MBR(S1, a) - MBR(S2, a) for
the remaining entry a - Add to the group whose covering rectangle will
have to be enlarged least
A
B
E
F
27Conclusion
- R-tree index structure
- 3 operations
- Search
- Insertion ( with split )
- Deletion
28Q A