This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ytes, and a block pointer is P = 6 bytes. Each B-tree node can have at most p tree pointers, p - 1 data pointers, and p - 1 search key field values. Hence, (pP)((p-1)(PrV)) B (p6)((p-1)(79)) 512 (22p) 528 We can choose p to be a large value that satisfies the above inequality, which gives p = 23.
32 E.g.2. (to calculate the no. of blocks and levels a B-tree) Suppose the search field of the above example is a nonordering key field and we construct a B-tree on this field. Assume that each node of the B-tree is 69% full. Then, p0.69 = 230.69 16 pointers per node, 15 search key field values per node, the average fan-out fo = 16, and others values is as follows:
Root Level 1: Level 2: Level 3: 1 node 16 nodes 256 nodes 4096 nodes 15 entries 240 entries=15x16 3840 entries 61,440 entries 16 pointers 256 pointers 4096 pointers Hence, a two-level B-tree holds up to 3840 + 240 + 15 = 4095 entries on the average; and a three-level B-tree holds up to 65,535 entries on the average.
33 E.g.3. (to calculate the order of p of a B+-tree) Suppose the values V, B, Pr and P are the same as Example 1. An internal node of the B+-tree can have up to p tree pointers, and p - 1 search key field values. Hence, (pP)((p-1)V) B, (p6)((p-1)9) 512, (15p) 521. We can choose p to be a large value that satisfies the above inequality, which gives p = 34. In the same manner, (Pleaf(PrV))P B, (Pleaf(79))6 512, (16Pleaf) 506. I...
View Full Document
This note was uploaded on 10/25/2009 for the course EE 2011 taught by Professor Denny during the Spring '09 term at National Tsing Hua University, China.
- Spring '09