GATE CS 2024 Set 2 — Question 26

MSQ+1 / -0MediumIndexing & File OrganizationDatabases

Databases → Indexing & File Organization

Last updated

Question

Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
A.
Sorted
B.
Heap
C.
Unclustered tree index
D.
Unclustered hash index

Correct answer

(A) Sorted; (B) Heap

Solution

A scan operation involves retrieving all records in the relation.
(A) TRUE: In a Sorted file organization, records are stored sequentially. Scanning involves reading blocks contiguously, which is very I/O efficient.
(B) TRUE: In a Heap file organization, records are stored in data blocks without any specific order. Scanning simply requires reading all the data blocks sequentially, which is I/O efficient.
(C) FALSE: An Unclustered tree index stores pointers to data records. Scanning via the index requires traversing the leaf nodes and then fetching each record from the data file. Since the data file is not sorted by the index key, this leads to random I/O for every record, which is very inefficient.
(D) FALSE: An Unclustered hash index is designed for point queries. Scanning requires iterating through buckets and following pointers to data records, resulting in random I/O, which is inefficient.

More questions on Indexing & File Organization

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free