File System


Question 1
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.

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 b blocks takes \left \lceil \log_2 b \right \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 _____
A
4
B
6
C
8
D
16
GATE CSE 2023   Database Management System
Question 2
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 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 ______
A
235
B
248
C
488
D
698
GATE CSE 2021 SET-2   Database Management System


Question 3
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo.

Which of the following operations will necessarily require a full scan of foo for successful completion?
[MSQ]
A
Creation of a new file in foo
B
Deletion of an existing file from foo
C
Renaming of an existing file in foo
D
Opening of an existing file in foo
GATE CSE 2021 SET-1   Database Management System
Question 4
Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and the size of tree/disk pointer is 8 bytes. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required to retrieve any record in the database is _______
A
2
B
3
C
4
D
5
GATE CSE 2020   Database Management System
Question 5
Which one of the following statements is NOT correct about the B^+ tree data structure used for creating an index of a relational database table?
A
B^+ Tree is a height-balanced tree
B
Non-leaf nodes have pointers to data records
C
Key values in each node are kept in sorted order
D
Each leaf node has a pointer to the next leaf node
GATE CSE 2019   Database Management System


There are 5 questions to complete.

Leave a Comment