Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multidimensional Index Structures One dimensional index structures assume a single search key, and retrieve records that match a given search-key value.

Similar presentations


Presentation on theme: "Multidimensional Index Structures One dimensional index structures assume a single search key, and retrieve records that match a given search-key value."— Presentation transcript:

1 Multidimensional Index Structures One dimensional index structures assume a single search key, and retrieve records that match a given search-key value. (The search key can be a single field or a combination of fields.) One dimensional index structures assume a single search key, and retrieve records that match a given search-key value. (The search key can be a single field or a combination of fields.) Many applications, e.g. GIS, OLAP, require us to view data as existing in a space of two or more dimensions. Many applications, e.g. GIS, OLAP, require us to view data as existing in a space of two or more dimensions.

2 Multidimensional Index Structures The queries to be supported on such data: The queries to be supported on such data: partial-match queries: specify values for a subset of the dimensions partial-match queries: specify values for a subset of the dimensions range queries: give the range for each dimension. range queries: give the range for each dimension. nearest-neighbor queries: ask for the closest point to the given point. nearest-neighbor queries: ask for the closest point to the given point.

3 Grid File The grid file slices the space of points in each of the dimensions. The grid file slices the space of points in each of the dimensions. Each of the regions can be thought of as a bucket, and each of the points in that region has its record placed in a block belonging to that bucket. If needed, overflow blocks can be used to increase the size of a bucket. Each of the regions can be thought of as a bucket, and each of the points in that region has its record placed in a block belonging to that bucket. If needed, overflow blocks can be used to increase the size of a bucket.

4 Age Salary 26 60 45 60 50 75 50 100 50 120 70 110 85 140 30 260 25 400 45 350 50 275 60 260 * * * * * * * * * * ** 0 40 55 100 500 225 90 0 Age Salary

5 25, 60 25, 400 30, 260 50, 75 45, 60 50, 120 50, 100 50, 275 85, 140 70, 110 45, 350 60, 260 0-40 40-55 55+ 225+ 90-225 0-90

6 Searching A grid directory consists of a k- dimensional array (grid array) and k one- dimensional arrays (linear scales). A grid directory consists of a k- dimensional array (grid array) and k one- dimensional arrays (linear scales). To search for a record: To search for a record: determine the positions of the record in each of the dimensions according to the linear scales determine the positions of the record in each of the dimensions according to the linear scales locate the proper bucket in the grid array locate the proper bucket in the grid array access the data block access the data block

7 Insertion Locate the bucket for the new record, then place the record in the block of the bucket if there is room. Locate the bucket for the new record, then place the record in the block of the bucket if there is room. If no room, two general approaches: If no room, two general approaches: add an overflow block as needed; add an overflow block as needed; refine the grid partition by splitting blocks; there is a choice of dimension and point of split. refine the grid partition by splitting blocks; there is a choice of dimension and point of split.

8 Performance Assumption: Assumption: the bucket matrix can be kept in main memory the bucket matrix can be kept in main memory the array of partitioning values in each dimension can be kept in main memory the array of partitioning values in each dimension can be kept in main memory Point query Point query the number of I/Os is what is necessary to read the bucket. the number of I/Os is what is necessary to read the bucket. For insertion and deletion, an additional disk write is needed. For insertion and deletion, an additional disk write is needed.

9 More about Grid File Partial-match query Partial-match query Range query Range query Nearest-neighbor query Nearest-neighbor query Reference: Reference: J. Nievergelt, et al., The grid file: an adaptable, symmetric, multikey file structure, ACM Trans. on Database Systems 9:1(1984), pp. 38-71. J. Nievergelt, et al., The grid file: an adaptable, symmetric, multikey file structure, ACM Trans. on Database Systems 9:1(1984), pp. 38-71.


Download ppt "Multidimensional Index Structures One dimensional index structures assume a single search key, and retrieve records that match a given search-key value."

Similar presentations


Ads by Google