GATE / CS ARCHIVE

GATE CSE 2024 SET 2 / QUESTION 26

Choose file organizations for a full scan

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2024 Set 2 paper

GATE 2024 Set 2, Q26 1 mark · MSQ
Report issue

Indexing, Storage & Query Processing

Question 26, GATE 2024: Which file organizations are I/O-efficient for scanning all records? A sorted file; B heap file; C unclustered tree index; D unclustered hash index.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B

Approach: Optimize for reading the entire data set, not for retrieving a few qualifying records.

1. Derivation. A full scan of a sorted file or a heap file reads the data pages sequentially, usually once each. Scanning through an unclustered index can chase record pointers to many scattered data pages, causing repeated/random I/O. Thus the I/O-efficient file organizations for the full scan are A, B; a selective index lookup is a different workload.

2. Explanation and checks. For a data file occupying B pages, scanning the file in its physical order takes about B page reads whether the records have a sorted order or an arbitrary heap order. An unclustered index does not group the data records in index traversal order, so neighboring index entries may point to different pages and cause random accesses or rereads. The index also has its own pages to read. Selectivity can make an index attractive for lookup, but that is absent in a full scan.

Original paper, page 18 · Answer key