Chapter 10-Tree Indices (9-14)

Chapter 10-Tree Indices (9-14) - Tree-Structured Indexes...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Tree-Structured Indexes Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Introduction For any index, 3 alternatives for data entries k* : Data record with key value k < k , rid of data record with search key value k > < k , list of rids of data records with search key k > Database Management Systems, R. Ramakrishnan and J. Gehrke 2 Choice is orthogonal to the indexing technique used to locate data entries k* . Tree-structured indexing techniques support both range searches and equality searches . ISAM : static structure; B+ tree : dynamic, adjusts gracefully under inserts and deletes. Range Searches `` Find all students with gpa > 3.0 If data entries are sorted, do binary search to find first such student, then scan to find others. P bl Database Management Systems, R. Ramakrishnan and J. Gehrke 3 Problem? Page 1 Page 2 Page N Page 3 Data (Entries) File Range Searches Simple idea: Create an `index file What is search cost if each index page has F entries? Database Management Systems, R. Ramakrishnan and J. Gehrke 4 Can do binary search on (smaller) index file! Page 1 Page 2 Page N Page 3 Data File k2 kN k1 Index File ISAM Index file may still be quite large. But we can apply the idea repeatedly! P K 1 P 1 K 2 P 2 K m P m index entry Database Management Systems, R. Ramakrishnan and J. Gehrke 5 Leaf pages contain data entries . Non-leaf Pages Pages Overflow page Primary pages Leaf Example ISAM Tree Each node can hold 2 entries What is search cost if each leaf node can hold L entries and each index node can hold F entries? 40 Root Database Management Systems, R. Ramakrishnan and J. Gehrke 6 10* 15* 20* 27* 33* 37* 40* 46* 51* 55* 63* 97* 20 33 51 63 40 After Inserting 23*, 48*, 41*, 42* ... 20 33 51 63 40 Root Index Pages Database Management Systems, R. Ramakrishnan and J. Gehrke 7 10* 15* 20* 27* 33* 37* 40* 46* 51* 55* 63* 97* 41* Overflow Pages Leaf Pages Primary 23* 48* 42* Then Deleting 42* 20 33 51 63 40 Root Index Pages Database Management Systems, R. Ramakrishnan and J. Gehrke 8 10* 15* 20* 27* 33* 37* 40* 46* 51* 55* 63* 97* 41* Overflow Pages Leaf Pages Primary 23* 48* 42* Then Deleting 51* 20 33 51 63 40 Root Index Pages Database Management Systems, R. Ramakrishnan and J. Gehrke 9 10* 15* 20* 27* 33* 37* 40* 46* 51* 55* 63* 97* 41* Overflow Pages Leaf Pages Primary 23* 48* After Deleting 41* and 51* 20 33 51 63 40 Root Index Pages Database Management Systems, R. Ramakrishnan and J. Gehrke 10 10* 15* 20* 27* 33* 37* 40* 46* 55* 63* 97* 41* Overflow Pages Leaf Pages Primary 23* 48* Note 51 appears in Index Page but not in Leaf pages!...
View Full Document

Page1 / 14

Chapter 10-Tree Indices (9-14) - Tree-Structured Indexes...

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