retagged by
9,041 views
20 votes
20 votes
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 $\textrm{RollNo}$. The size of a record pointer for this disk is $7$ bytes. Each student-record has a candidate key attribute called $\textrm{ANum}$ of size $12$ bytes. Suppose an index file with records consisting of two fields, $\textrm{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 ________
retagged by

1 Answer

Best answer
40 votes
40 votes

ANS = 698 .

Index is being built on attribute “ANum” which is Candidate Key, but Given that file is Sorted on Primary Key “Roll No”.

This indicates that The Index must a Secondary Index, (data records not being physically ordered as per the index making a dense record necessary) so “THERE SHOULD EXIST AN INDEX RECORD FOR EVERY RECORD of Original ‘Student Table’ ”.

=> Also this Line: “Assume that Records of data file and index file are not split across disc blocks”.

This indicates UNSPANNED STRATEGY.

With This Knowledge, let’s see the Data given.

→ Record Size in Index $= 12 + 7 = 19 \text{ B}$ (‘ANum’ key size + Record pointer Size), and Block Size $= 4096 \text{ B}$

→ So number of Index records in 1 Block $= \left \lfloor \frac{4096}{19} \right \rfloor= 215$ records in 1 block (Remember again, unspanned strategy).

→ So number of blocks in the Index file $= \dfrac{\text{Total Number of records}}{\text{Records per block}} = \left \lceil \dfrac{1,50,000}{215}\right \rceil = 698.$

(Recall that this is Secondary Index)

edited by
Answer:

Related questions

20 votes
20 votes
6 answers
3
Arjun asked Feb 18, 2021
9,303 views
Consider the following deterministic finite automaton $\text{(DFA)}$The number of strings of length $8$ accepted by the above automaton is ___________
13 votes
13 votes
3 answers
4
Arjun asked Feb 18, 2021
4,753 views
If $x$ and $y$ are two decimal digits and $(0.1101)_2 = (0.8xy5)_{10}$, the decimal value of $x+y$ is ___________