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)?
- A. 5,242,880
- B. 5,267,025
- C. 1,358,954,496
- 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
- A query scans a table of 11 pages sequentially, 5 times in a row, with a buffer pool of 10 pages (initially empty). How many buffer hits…
- An ER model has entity sets E1, E2, E3 and a weak entity W (identified through E3 by an identifying 1:N relationship). Relationships…
- Entity sets A (6 entities) and B (9 entities) are linked by relationship R. Every A entity must take part in R (total participation) and…
- E1(id, d, s): (1,x,50), (2,x,70), (3,x,70), (4,y,40), (5,y,40), (6,z,90), (7,z,NULL), (8,w,NULL). How many rows does SELECT FROM E1 a…
- LG(g, t, v): (a,1,10), (a,2,15), (a,3,12), (b,1,7), (b,2,7), (b,3,20). What does SELECT SUM(d) FROM (SELECT v - COALESCE(LAG(v) OVER…
- DD(id, k, v): (1,1,a), (2,1,b), (3,2,c), (4,2,d), (5,2,e), (6,3,f), (7,NULL,g), (8,NULL,h). A cleanup runs DELETE FROM DD WHERE id NOT IN…