CS FundamentalsVery hardProduct-company MCQ pattern
A file of 30,000 records (100 bytes each, unspanned) is sorted on key K and stored in 1,024-byte blocks. A primary (sparse) index on K uses 15-byte entries (9-byte key + 6-byte pointer), one per data block. How many block accesses are needed to find a record by binary search on the data file, and by binary search on the index plus one data access?
- A. 15 and 7
- B. 12 and 7
- C. 15 and 13
- D. 12 and 6
Correct answer: B. 12 and 7
Data: 1024/100 = 10 records per block, 3,000 blocks, ⌈log₂ 3000⌉ = 12 accesses. Index: 1024/15 = 68 entries per block; 3,000 entries need ⌈3000/68⌉ = 45 blocks; ⌈log₂ 45⌉ = 6, plus 1 data block = 7. 15 is ⌈log₂ 30000⌉, wrongly searching records instead of blocks.
More DBMS and SQL questions
- A B+ tree indexes 1,000,000 keys. Every leaf holds 100 keys and every internal node has 100 children, and all nodes are completely full…
- An ER design has entity sets E1 and E2 joined by a one-to-one relationship R. Both E1 and E2 participate TOTALLY in R, and neither has a…
- Assertion (A): In SQL, WHERE dept = NULL returns no rows even when dept contains NULL values. Reason (R): A comparison with NULL using =…
- How many of the following statements are correct? 1. A phantom read occurs when re-running a query with the same predicate returns new…
- Match each concept with its description: (P) Partial dependency (Q) Transitive dependency (R) BCNF violation (S) Multivalued dependency…
- How many of the following statements about indexing are correct? 1. A B+ tree stores data pointers only in its leaves, which are linked…