B tree indexes non leaf pages leaf pages leaf pages

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: ap file (with some free space on each page for future inserts). Overflow pages may be needed for inserts. (Thus, order of data recs is `close to’, but not iden6cal to, the sort order.) CLUSTERED Index entries direct search for data entries Data entries UNCLUSTERED Data entries (Index File) (Data file) Data Records Data Records Hash ­Based Indexes •  Good for equality selec6ons. •  Index is a collec6on of buckets. Bucket = primary page plus zero or more overflow pages. •  Hashing funcBon h: h(r) = bucket in which record r belongs. h looks at the search key fields of r. •  If Alterna6ve (1) is used, the buckets contain the data records; otherwise, they contain <key, rid> or <key, rid ­list> pairs. B+ Tree Indexes Non-leaf Pages Leaf Pages   Leaf pages contain data entries, and are chained (prev & next)   Non-leaf pages contain index entries and direct searches: index entry P0 K1 P1 K2 P2 K m Pm Example B+ Tree Root 17 Entries < 17 5 2* 3* Entries >= 17 27 13 5* 7* 8* 14* 16* 22* 24* 30 27* 29* 33* 34* 38* 39* •  Find 28*? 29*? All > 15* and < 30* •  Insert/delete: Find data entry in leaf, then change it. Need to adjust parent some6mes. –  And change some6mes bubbles up the tree Cost Model for Our Analysis W...
View Full Document

This document was uploaded on 03/12/2014 for the course CSCI 165B at UC Davis.

Ask a homework question - tutors are online