Download presentation
Presentation is loading. Please wait.
Published by현수 송 Modified over 6 years ago
1
The Quad tree The index is represented as a quaternary tree
Each internal node has four children, one per quadrant NW, NE, SW, SE Each leaf is associated a disk page, which stores the index entries
2
The kd-tree A binary tree
At each node, a dimension is selected to partition the space into two Disk-based variants: KDB-tree, skd x1 X=x1 Y=y1 y1 y2
3
Mapping -- Indexing using PAMs
Map the MBR in 2-d into a point in 4-d: [(x1, x2), (y1, y2)] (x1, x2, y1, y2) Transform the query into the new space Use a 4-d PAM to answer queries. b Q Q a a b
4
Space Filling Curves Assumption: att. values can be represented with some fixed # of bits Space domain on each dimension: 2k values Linearize the doman Each point can be represented by a single dimensional value
5
Z-ordering 11 10 01 00 00 01 10 11
6
Z-ordering The z-value is obtained by interleaving the bits.
Eg. X=01, Y=11 z-value = 0111 = 7 Clustering effect on X-Y and z-values can be indexed using B+-trees Range queries: problematic?
7
Z-ordering & Locational Keys
11 142 144 120 140 10 141 143 100 01 110 130 Space filing curves techniques include peano curve, hilbert curve, gray ordering and z-ordering. In z-ordering, the bits from each dimension are interleaved. For example, … For a region, it is decomposed into several sub-regions, where each region can be represented by the A common prefix string. For example, … An alternative to space filling curve is the method proposed Abel and Smith in 84, where a quad-tree Representation is used to derive locational key. To some extent, the idea is similar to curve filling In philosophy. The problem of such method is the number of substrings need tobe used, and hence the number of Subqueries. 00 00 01 10 11 120 140 011* 110*
8
Hilbert Curve 111 110 101 100 011 010 001 000 000 001 010 011 100 101 110 111
9
Grid Files Based on extendible hashing
Grid Files Based on extendible hashing Design principle: any point query can be answered in at most 2 disk accesses. Two structures: k-dimensional array and k 1-dimensional array
10
Grid Files
11
Scales, Directory, Bucket
Scales, Directory, Bucket Data structures: Linear scales directory: an array whose elements are one-to-one correspondence with the grid cells; each entry points to a data bucket data buckets
12
Splitting and Merging
13
Splitting and Merging
14
Grid Files One page is associated with each cell
When a cell overflows, it is split into two cells and the points are assigned to the new cell Two adjacent cells (buddies) can reference the same page
15
Grid Files... Repetitive splitting by halving
Grid Files... Repetitive splitting by halving Merging based on buddy system Regions are represented as (cx, cy, dx, dy) point queries: cx-dx <= qx <= cx+dx, & cy-dy <= qy <= cy+dy
16
Grid Files... dx cy E A D F E F B C D B cx qx dy A C B D cx C E A F cy
Grid Files... dx cy E A D E F F B C D B cx qx A dy C B cx D C E A F cy qy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.