The GATE Grind

GATE 2020 CS – Question 64

Databases · File Organization and Indexing (B and B+ Trees) · 2 marks · Numerical answer

Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and the size of tree/disk pointer is 8 bytes. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required to retrieve any record in the database is ______.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 4 to 4

Explanation

Order $p$ satisfies $8p+12(p-1)\le4096$, so $p=205$. The minimum height to index $10^6$ records is 3 levels ($205^2<10^6<205^3$), plus 1 access for the record block. Total 4.