Professional Documents
Culture Documents
Indexing Structures For Files: Database Design Database Design
Indexing Structures For Files: Database Design Database Design
Indexing Structures For Files: Database Design Database Design
Database Design
Primary Indexes
Clustering Indexes
Indexing Structures for Files Secondary Indexes
Multilevel Indexes
Dynamic Multilevel Indexes Using B-Trees and B+-
Trees
CS 6360.501 (Fall 2009)
Instructor: Sunan Han
The University of Texas at Dallas
Slide 14- 2
Such a multi-level index is a form of search tree A search tree of order p is a tree such that each
node contains at most p-1 search values and p
However, insertion and deletion of new index entries
pointers in the order <P1,K1,P2,K2, …, Pq-1,Kq-1,Pq>,
is a severe problem because every level of the index
where q ≤ p, each Pi is a pointer to a child node, or
is an ordered file
null and each Ki is a unique search value from some
This leads to dynamic multi-level indexes ordered set of values, and the following must hold:
Dynamic multi-level indexing leaves some additional 1. Within each node, K1 < K2 < …, < Kq-1
space in each block for inserting new entries 2. For all values X in the subtree pointed at by Pi,
Ki-1 < X < Ki, for 1<i<q and X < Ki if i=1, and Ki-1 < X
if i=q
Dynamic Multilevel Indexes Using B-Trees and Dynamic Multilevel Indexes Using B-Trees and
B+-Trees B+-Trees
In B-Tree and B+-Tree data structures, each node An insertion into a node that is not full is quite
corresponds to a disk block efficient
Most multi-level indexes use B-tree or B+-tree data If a node is full the insertion causes a split into two
structures because of the insertion and deletion problem nodes
Space has to be reserved in each tree node to allow for Splitting may propagate to other tree levels
new index entries A deletion is quite efficient if a node does not
Each node is kept between half-full and completely full become less than half full
If a deletion causes a node to become less than half
full, it must be merged with neighboring nodes
An Example
of an Insertion
in a B+-tree
Assignment #12
Slide 14- 35