You are on page 1of 14

Grid Files

Multi-dimensional Index Structures

Properties of Grid Files


Support multi-dimensional data, but not high-dimension. Every key is treated as primary key. The index structure adapts itself dynamically to maintain storage efficiency. Guarantee two disk accesses for point queries Values of key must be in lineralyordered domain.
Grid Files 2

Jaruloj Chongstitvatana 2006

Structure of Index Structure

Grid directories: for k-dimensional data

Grid array
A k-dimensional array Each element is a pointer to a data page

Linear scales
k 1-dimensional array Each array defines the partition of values in each dimension.

Data buckets/ pages


Grid Files 3

Jaruloj Chongstitvatana 2006

Grid Directory

Linear Pointers scales to data buckets/pages Grid array


Jaruloj Chongstitvatana 2006 Grid Files 4

Point Query
Y X
0 6 25 32

Jaruloj Chongstitvatana 2006

A F K O Z

Find x=9 and y=Rat


Grid Files 5

Range Query
Y X
0 6 25 32

Find 5<x<9 and Mat<y<Rat


Jaruloj Chongstitvatana 2006 Grid Files 6

A F K O Z

Insertion

Also, Update split the the linear data scale page Overflow, then split the region
Jaruloj Chongstitvatana 2006 Grid Files 7

Insertion

This data page is not split.

Update linear scale Overflow, Only the overflowed then split the data region page is split
Jaruloj Chongstitvatana 2006 Grid Files 8

Insertion

The Therefore, data page splitis only overflowed, the data but page the directory is not
Jaruloj Chongstitvatana 2006 Grid Files 9

Insertion

Jaruloj Chongstitvatana 2006

Grid Files

10

Merging

1 3

C
E
2

D
F A
Grid Files

1 2

B C E

Jaruloj Chongstitvatana 2006

D 11 F

Deletion

B C ED F

C
E

D
Delete point

Merge does not occur data pages A and B, but directory pages cannot be merged yet.
Jaruloj Chongstitvatana 2006 Grid Files 12

Deletion

B C ED F

C
E

D
Delete point

Merge data pages D and F. Directory pages are also merged.


Jaruloj Chongstitvatana 2006 Grid Files 13

Deletion

B CE DF

Delete point

CE

DF

Merge data pages CE and DF. Directory pages are also merged.
Jaruloj Chongstitvatana 2006 Grid Files 14

You might also like