GATE CS 2021 Set 2 — Question 31
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+1 / -0HardPrimary & Secondary IndexesIndexing & File OrganizationDatabases
Databases → Indexing & File Organization → Primary & Secondary Indexes
Last updated
Question
A data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key
RollNo. The size of a record pointer for this disk is 7 bytes. Each student-record has a candidate key attribute called ANum of size 12 bytes. Suppose an index file with records consisting of two fields, ANum value and the record pointer to the corresponding student record, is built and stored on the same disk. Assume that the records of data file and index file are not split across disk blocks. The number of blocks in the index file is ___________.Correct answer
698 to 698
Solution
1.Identify the Index Type: The data file is sorted on the primary key
RollNo, but the index is being built on ANum (a candidate key). Since the index is not on the ordering attribute of the file, it is a secondary index. Secondary indices are dense, meaning there is one index entry for every record in the data file.2.Number of Index Entries (): Since it is a dense index, the number of index entries is equal to the number of records in the data file.
3.Size of an Index Record (): Each index record consists of the search key (
ANum) and a record pointer.4.Blocking Factor for the Index File (): This is the number of index records that can fit in one disk block. Since records cannot be split across blocks:
5.Number of Blocks in the Index File ():
Thus, the number of blocks in the index file is 698.Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Indexing & File Organization
2026 Set 2 Q15In the context of DBMS, consider the two sets T and S given below. | T | S | |---|---| | I:…2026 Set 2 Q20Consider concurrent execution of two transactions and in a DBMS, both of which access a…2026 Set 1 Q30Let and be the attributes of a relation in a relational schema. Let…2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 2 Q42In the context of schema normalization in relational DBMS, consider a set F of functional…