GATE CS 2023 Set 1 — Question 62

Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.
NAT+2 / -0MediumPrimary & Secondary IndexesIndexing & File OrganizationDatabases

Databases → Indexing & File Organization → Primary & Secondary Indexes

Last updated

Question

Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a block-aligned ordered file. The figure below depicts this indexing scheme.
A diagram showing the relationship between an Index File and a Data File. The Index File contains blocks with 'Block Anchor Primary Key' and 'Block Pointer'. The Data File contains blocks with 'Primary Key (15 Bytes)' and 'Other Fields (85 Bytes)'. Arrows show pointers from the Index File to the start of blocks in the Data File.
Suppose the block size of the file system is 1024 bytes, and a pointer to a block occupies 5 bytes. The system uses binary search on the index file to search for a record with a given key. You may assume that a binary search on an index file of bb blocks takes log2b\lceil \log_2 b \rceil block accesses in the worst case.
Given a key, the number of block accesses required to identify the block in the data file that may contain a record with the key, in the worst case, is ________.
Your answer

Enter a number. Decimals, negative values and scientific notation are accepted.

The solution stays hidden until you check.

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