Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
Answer
(A), (B)
Explanation
A scan retrieves every record of the file, so the best possible cost is to read each data page exactly once.
- Heap and sorted files keep their records packed in data pages, so a scan reads all \(B\) pages in sequence, one I/O per page. Both are I/O efficient.
- With an unclustered index, tree or hash, the records are reached through the index entries. The order of the entries has nothing to do with where the records sit on disk, so consecutive entries usually point to different pages. The scan then costs about one page I/O per record, plus the reads of the index itself, which is far more than \(B\) when a page holds many records.
Answer: A, B