CS FundamentalsHardGATE CS (PYQ pattern)

A heap file stores 1,000,000 fixed-length records of 150 bytes in 8192-byte blocks with no block header; records do not span blocks. How many blocks does the file need, and how many bytes are wasted per full block?

  1. A. 18,311 blocks; 92 bytes
  2. B. 18,519 blocks; 92 bytes
  3. C. 18,519 blocks; 102 bytes
  4. D. 19,519 blocks; 92 bytes

Correct answer: B. 18,519 blocks; 92 bytes

Blocking factor = floor(8192 / 150) = 54; blocks = ceil(1,000,000 / 54) = 18,519; waste per block = 8192 - 54 x 150 = 92 bytes. Ignoring the unspanned waste gives 18,311.

More DBMS and SQL questions

Exams that ask this topic