CS FundamentalsVery hardGATE CS · DBMS
A file has 50,000 records of 200 bytes stored unspanned in 2048-byte blocks, NOT ordered on attribute X. A dense secondary index on X (a candidate key) has one entry per record: a 12-byte key and a 8-byte record pointer. Searching by binary search on the index plus one data-block read needs how many block accesses in the worst case?
- A. 9
- B. 7
- C. 10
- D. 2500
Correct answer: C. 10
Dense index: 50,000 entries, ⌊2048/20⌋ = 102 per block, so 491 index blocks; ⌈log₂ 491⌉ = 9, +1 data block = 10. (A linear scan of the file would average about 2,500 blocks.)
More DBMS and SQL questions
- A table Teach(course, teacher, book) records that each course is taught by several teachers and uses several books, independently of each…
- How many of these statements are correct? 1. A BCNF decomposition obtained by the standard algorithm is always lossless. 2. A BCNF…
- R(A, B, C, D, E, F) has functional dependencies AD → BF, BD → F, F → A. How many superkeys does R have?
- R(A, B, C, D, E) with functional dependencies A → E, D → C, C → DE is decomposed into R1(C, D, E), R2(A, B, C). Which statement is correct?
- Which statement about linear hashing is correct?
- R(A, B, C, D, E, F) has functional dependencies AC → BE, D → E, C → A, AB → F. What is the closure {BC}⁺?