29 new version 30 31 b tree vs b tree eg1 to calculate

Info icon This 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: 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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern