CS FundamentalsModerateGATE CS (PYQ pattern)
A secondary dense index on a non-key attribute of a file with 1,000,000 records uses 4096-byte pages, 12-byte key + 8-byte pointer entries and a multilevel index (each higher level is a sparse index on the level below). How many levels does the index need until the top level fits in one page?
- A. 2
- B. 3
- C. 4
- D. 5
Correct answer: B. 3
Entries per page = floor(4096 / 20) = 204. Level 1: ceil(1,000,000 / 204) = 4902 pages; level 2: ceil(4902 / 204) = 25 pages; level 3: 1 page. So 3 levels.
More DBMS and SQL questions
- A table of 1,000,000 rows (100 rows per page, 10,000 pages) is clustered on A, with a B+ tree whose leaves hold 200 entries each; reaching…
- Sort-merge join of R (200 pages) and S (100 pages) with 15 buffer pages: each relation is fully sorted by external merge sort (pass 0…
- Under the deferred database modification scheme with a log, a crash occurs. The log holds <T1 start>, <T1,A,5>, <T1 commit>, <T2 start>…
- Under strict 2PL, T1 and T2 both hold S(A) and each now requests X(A) (a lock upgrade). T3 holds S(B) and requests X(A). T4 holds X(C) and…
- An ER diagram has a supertype PERSON(pid, name) with disjoint, total specialisation into STUDENT(gpa) and TEACHER(salary). Using the 'one…
- Relations R(A, B, C) with key A and S(C, D) with key C, where R.C is a foreign key to S. A row of S that is referenced by some R rows is…