recategorized by
6,739 views
40 votes
40 votes
An $\text{ISAM}$ (indexed sequential) file consists of records of size $64$ bytes each, including key field of size $14$ bytes. An address of a disk block takes $2$ bytes. If the disk block size is $512$ bytes and there are $16K$ records, compute the size of the data and index areas in terms of number blocks. How many levels of $\text{tree}$ do you have for the index?
recategorized by

3 Answers

Best answer
68 votes
68 votes
Answer: $3$

Size of each index entry = $14$ + $2$ = $16$ $B$

Blocking factor of record file = $\frac{\text{Block size}}{\text{Record size}}$ = $512$ B/$64$ B = $8$

Blocking factor of index file = $\frac{\text{Block size}}{\text{Index entry size}}$ = $512$ B/$16$ B = $32$

No. of Blocks needed for data file = $\frac{\text{No. of Records}}{\text{Blocking factor of record file}}$ = $16$ K/$8$ = $2$ K

No. of first level index entries = No. of Data Blocks needed for data file = $2$ K

No. of first level index blocks = $\lceil \frac {\text{No. of first level index entries}}{\text{Blocking factor of index file}} \rceil$ = $\lceil \frac{2 K}{32} \rceil$  = $64$

No. of second level index entries = No. of first level index blocks = $64$

No. of second level index blocks = $\lceil \frac {\text{No. of second level index entries}}{\text{Blocking factor of index file}}\rceil$ = $\lceil \frac{64}{32} \rceil$ = $2$

No. of third level index entries = No. of second level index blocks = $2$

No. of third level index blocks = $\lceil \frac {\text{No. of third level index entries}}{\text{Blocking factor of index file}} \rceil$ = $\lceil \frac{2}{32} \rceil$ = $1$
edited by
38 votes
38 votes
record size = 64B
no of records = 16k
total size of records = 64*16k
no of block to store records = 64*16k/512 = 2k

key size = 14B
Address size = 2B
no of block for 1st level index = no of keys *key size / block size
                                                      = 2k * (14+2)/ 512
                                                      = 64 block
no block for second level index = 64*16/512
                                                         = 2
no ofof block for 3rd level index = 2*16/512
                                                          = 1 block

total 3 level indexing.
1 votes
1 votes
NO. of blocks = (16K * 64)/512 = 2K

key size = 14 bytes, pointer size = 2 bytes

no. of record in 1 index block = 512/16  = 32.

so. no of block at 1 st index = 2k/32 = 64.

no. of block at second level index = 64/32 = 2

no. of block at 3rd level index = 1.
Answer:

Related questions

38 votes
38 votes
2 answers
3
30 votes
30 votes
4 answers
4
Kathleen asked Sep 29, 2014
4,524 views
Let $\left(\{ p,q \},*\right)$ be a semigroup where $p*p=q$. Show that:$p*q=q*p$ and$q*q=q$