CS FundamentalsHardGATE CS (PYQ pattern)

A B+ tree has 4096-byte nodes, 10-byte keys and 6-byte tree pointers. An internal node with n pointers carries n - 1 keys. A leaf holds (10-byte key + 40-byte record pointer) entries plus one 6-byte next-leaf pointer. What is the maximum number of records indexed by a tree with 3 levels (root, one internal level, leaves)?

  1. A. 5,242,880
  2. B. 5,267,025
  3. C. 1,358,954,496
  4. D. 5,308,416

Correct answer: D. 5,308,416

Internal fan-out n: n x 6 + (n-1) x 10 <= 4096 gives n = 256. Leaf entries m: m x 50 + 6 <= 4096 gives m = 81. Three levels hold at most 256 x 256 leaves, i.e. 256^2 x 81 = 5,308,416 records.

More DBMS and SQL questions

Exams that ask this topic