Btrees - B-Trees. [Cormen-Leiserson-Rivest] 1. Search trees...

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

View Full Document Right Arrow Icon
B-Trees.[Cormen-Leiserson-Rivest] 1. Search trees designed to minimize IO operations to secondary memory. When database is too large to fit in main memory, some parts will be stored in disk. A single access to disk can be 10^3 to 10^5 times slower than access to memory. (Disks rotate at about 7200 RPM; typical range 5K-15K RPM. One rotation takes 8.33 ms, which is about 5 orders slower than a 100 nano sec access for current silicon memory.) 2. In order to amortize the disk access cost, store and fetch in large chunk, instead of single items. Information is divided into large, equal-sized "pages" that are laid out consecutively within each cylinder. Typical page size: 2^11 to 2^14 bytes (2K-16K). Often, it takes longer to read one page of information than to examine it (compute). Thus, when dealing with disk-bound data structures, we look at two factors separately: a. number of disk accesses, b. the CPU time. 3. B-Tree algorithms operate at the granularity of pages. I.e., the unit operations are to READ or WRITE a page. The main memory can only accomodate only so many pages, so older pages will be flushed out as new ones are fetched. 4. Since we want to optimize the number of page accesses, we will choose the size of the B-Tree node to match the page size. That is, each node will store keys for about 50-2000 items, and will have the similar branching factor. As an example, with a branching factor of 1001 (each node with 1000 keys), 1 billion keys can be accessed by a tree of height 2. Just 2 disk accesses! Figure: 5. Definition of a B-Tree. A B-Tree is a rooted tree with the following properties: 1. Every node x has: a. n(x): the number of keys stored at x b. the n(x) keys themselves sorted, key_1[x] <= key_2[x] <=. .. c. leaf(x) boolean, which is true if x is a leaf. 2. Each non-leaf node contains n(x)+1 pointers, c_1(x), c_2(x), .
Background image of page 1

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

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

This note was uploaded on 12/27/2011 for the course CMPSC 130a taught by Professor Suri during the Fall '11 term at UCSB.

Page1 / 5

Btrees - B-Trees. [Cormen-Leiserson-Rivest] 1. Search trees...

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

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