lec14 - B Tree Indexes Chapter 10 EECS 484 Database...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 1 B+ Tree Indexes Chapter 10 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 2 Indexes Disk-based data structures to improve the performance of equality (and range) searches Organize records on disk to speed up selections on the search key (denoted k ) Any subset of the attributes of a relation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 3 B+ Tree Motivation Range and equality searches very common Can scan heap file, but this is expensive! Databases are dynamic (must support updates efficiently) Goal: Create a dynamic index structure that allows for efficient evaluation of equality and range queries 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 4 B+ Tree Height-balanced (dynamic) tree structure Invariant: Minimum 50% occupancy at each node (except for root) Supports equality and range-searches Index Entries Data Entries Index Entries Entries in the non-leaf pages: (search key value, pageid)
Background image of page 2
3 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 5 Indexes Leaves store a collection of data entries Data entry for search key k denoted k* Alternative ways to store data entry k*: 1: Data entry k* is an actual database record (with search key k) Index == File ! 2: k* is (k, rid) pair, where rid is refers to a record with search key k Actual data records stored in a different file 3: k* is (k, rid-list) pair; rid-list refers to list of records with search key k 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 6 Example B+ Tree Search: Starting from root, examine index entries in non-leaf nodes, and traverse down the tree until a leaf node is reached Non-leaf nodes can be searched using a binary or a linear search. Search for 5*, 15*, all data entries >=24* Root 17 24 30 2* 3* 5* 7* 14* 16* 19* 20* 22* 24* 27* 29* 33* 34* 38* 39* 13 Height = 1 < 13 13 x< 17
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 3/8/11 EECS 484: Database Management Systems, Kristen LeFevre 7 B+-tree Page Format Leaf Page R 1 K 1 R 2 K 2 K n P n+1 data entries (Alternative 2) record 1 record 2 Next Page Pointer R n record m P 0 Prev Page Pointer Non-leaf Page P 1 K 1 P 2 K 2 P 3 K m P m+1
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2011 for the course EECS 484 taught by Professor Staff during the Winter '08 term at University of Michigan.

Page1 / 14

lec14 - B Tree Indexes Chapter 10 EECS 484 Database...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online