B+ Tree: Properties, Search, Insert, and Delete, Study Guides, Projects, Research of Introduction to Database Management Systems

An overview of b+ trees, including their properties, search algorithm, insertion process, and delete operation. It also discusses the advantages of using b+ trees over sorted files and other multilevel indexes. Examples and animations to help illustrate the concepts.

Typology: Study Guides, Projects, Research

2011/2012

Uploaded on 02/15/2012

arien
arien 🇺🇸

4.8

(24)

309 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Announcements
Today
Finish up B+ Trees
Relational Data Model
Reading assignment from last time
Chapter 5 and Sections 6.0-6.5
Exam
2 weeks from this coming Monday
Program 2 coming next week
Replace homework with powerpointizing lecture
Buffer Manager operations + LRU (a few weeks back)
B+ Tree concepts (today)
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download B+ Tree: Properties, Search, Insert, and Delete and more Study Guides, Projects, Research Introduction to Database Management Systems in PDF only on Docsity!

Announcements

Today

  • Finish up B+ Trees– Relational Data Model

Reading assignment from last time

  • Chapter 5 and Sections 6.0-6.

Exam

  • 2 weeks from this coming Monday

Program 2 coming next week

Replace homework with powerpointizing lecture

  • Buffer Manager operations + LRU (a few weeks back)– B+ Tree concepts (today)

Trees

B+ Tree Properties

A B+ tree is kept balanced (ie, distance from theroot to leaf is the same for each leaf)

Let

p

be the maximum number of tree pointers

on an internal block (the

order

of the B+Tree)

  • Other than root, each internal page has at least

ceil(p/2) tree pointers

  • A block with

q

tree pointers has

q-

search field

values

Key aspect of B+ trees are graceful algorithmsfor handling insertions and delete

Leaf Nodes

Together, leaf nodes are very similar to asecondary index

Leaf Nodes

Picture

Example 6: Calculating the

order

of a

B+Tree

Recall that the order of a B+ tree is themaximum number of tree pointers in a block

What does it depend on?

B+Tree Search

B+Tree_search( key )

B

Å

root block of B+Tree

while(

B

is not a leaf node )

if( key >

B

.key

q-

B

= *(B.

T

q

else{

k = 1;

while( key >= B.key

k

&& k <= q-1 ){

k++;

} B = *B.T

k

find and return RID on leaf page B

B+Tree Insert B+Tree Insert Animation

Misc. Thoughts on Indexes

For a frequently updated file, B+Tree index isalmost always superior to a sorted file

  • For small amount of space, we get all the advantages

of sorted files plus efficient insertion and deletion

On average B+trees are ~ 67% full

Bulk loading index Vs incremental construction

B+trees Vs other multilevel indexes

  • MLI blocks typically sequentially allocated, B+Tree

usually not

Key Compression – internal nodes of B+Treeneed not store full values

Indexes on multiple fields