Multidimensional Index - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Multidimensional Index

Description:

K-D-B Tree Multidimensional Index – PowerPoint PPT presentation

Number of Views:70
Avg rating:3.0/5.0
Slides: 27
Provided by: Jaruloj
Category:

less

Transcript and Presenter's Notes

Title: Multidimensional Index


1
K-D-B Tree
  • Multidimensional Index

2
Characteristics
  • Multi-way branch
  • Height-balanced tree
  • Repeatedly divide area of the domain into
    disjoint sub-area
  • A node in a tree corresponds to a (set of
    consecutive) disk page(s)

3
Example of Data Records
  • Table (stdntID, courseID, grade, year, smstr)
  • Table (accID, branchID, saving, name, addr)
  • Table (custID, age, gender, occupation, salary,
    children, promotion, since)

4
Nodes Pages
  • Region pages
  • Contain a set of ltregion, ptr. to pagegt
  • Internal nodes
  • Point pages
  • Contain a set of ltpoint, ptr. to data recordgt
  • Leaf nodes

5
Region Pages

Region
PAGE
PAGE
The branching factor is determined by the page
size and the size of each entry.
6
Point Pages

X
Y
X
Y
X
Y
DATA RECORD
DATA RECORD
DATA RECORD
POINT
The branching factor of a point page is usually
larger than that of a region page.
7
Example
Point page
Point page
Point page
Point page
8
Search
Point query
Point page
Point page
Point page
Point page
9
Insert
Insert a point here and the point page
overflows.
10
Split
  • Split a region r with page id p along xi
  • If r is on the right/page of xi then put ltr, pgt
    in the right/left page.
  • Otherwise
  • For each children pc of p , split pc along xi
  • Split r along xi into rleft and rright.
  • Create 2 new pages with page id pleft and
    pright.
  • Move children of p in the left region into pleft
    and children in the right region into pright.
  • Return ltrleft, pleftgt and ltrright, prightgt .

11
Split Example
The page overflows, and is splitted.
This region is also splitted.
This region is splitted.
12
Split Example
The region page is splitted. The point page is
also splitted.
Create a new region page.
Children pages are transferred.
13
How to find split axis
  • Cyclic x -gt y -gt x -gt y -gt
  • Priority x -gt x -gt y -gt x -gt x -gt y -gt
  • Possible one

14
Insert
  • Insert a record with point a and location l in a
    tree with root r
  • If r is NIL, then create a point page p and
    insert the record with lta,lgt in p and return p.
  • Otherwise
  • Search for a in the tree with root r until a
    point page, say p, is reached.
  • Insert the record in the point page p.

15
Insert (contd)
  • Insert a record with point a and location l in a
    tree with root r
  • If the point page p is overflowed, then find an
    appropriate axis to split p into pleft and
    pright.
  • If p is not the root, then change to p and
    pleft, and insert pright into the parent of p.
  • If p is the root, then create a new root node
    with two children of pleft and pright.

16
Insert Example
Search for the given point until the point page
is found.
Insert here and split point page if overflows.
Divide region.
17
Insert Example
Parent page overflows, then split the page.
This region is splitted.
18
Insert Example
The point page is splitted.
The region page is splitted.
19
Insert Example
Insert the new region page in its parent.
The root node is overflowed, and then splitted.
20
Insert Example
Create the new root node
21
Delete
  • Simple, if storage utilization is ignored.
  • Otherwise, an underfull page should be merged
    with another page.
  • When 2 pages are merged, the region of the new
    page must be a valid region.
  • A number of regions are joinable if their union
    is also a region.

22
Joinable Regions
23
Unjoinable Regions
24
Delete (contd)
  • If a page p is underfull, merge sibling pages of
    p whose regions are joinable.
  • If the newly-created page is overflowed, then
    split the page.

25
Further Discussion
26
Splitting Criteria
  • Axis
  • Cyclic
  • Priority
  • Shape ?
  • Value
  • Area
  • Number of data points
  • Ratio ?
  • Random ?

Combine the two decisions ?
Write a Comment
User Comments (0)
About PowerShow.com