• recategorized by
13,197 views
54 54 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?

4 Answers

Best answer
84 84 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
45 45 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 1 vote
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.
0 0 votes

Given:

  • Record size = 64 bytes
  • Key size = 14 bytes
  • Block size = 512 bytes
  • Address size = 2 bytes
  • Number of records = 16K = 16 × 1024 = 16384

1. Data Area

Records per block:

⌊512 / 64⌋ = 8

Therefore,

Data blocks = 16384 / 8 = 2048 blocks

2. Index Area

Each index entry contains:

Key + Address = 14 + 2 = 16 bytes

Index entries per block:

512 / 16 = 32

Level 1:

⌈2048 / 32⌉ = 64 blocks

Level 2:

⌈64 / 32⌉ = 2 blocks

Level 3:

⌈2 / 32⌉ = 1 block

Level-wise Summary

Data area = 2048 blocks

Index Level 1 = 64 blocks

Index Level 2 = 2 blocks

Index Level 3 = 1 block

Total index blocks = 64 + 2 + 1 = 67 blocks

Therefore:

Data area = 2048 blocks

Index area = 67 blocks

Number of index levels = 3

ago
Answer:
Position:
Show:

Related questions

20 20 votes
2 answers 2 answers
4.5k
4.5k views
go_editor asked Feb 5, 2018
4,454 views
The following relations are used to store data about students, courses, enrollment of students in courses and teachers of courses. Attributes for primary key in each rela...
29 29 votes
9 9 answers
7.8k
7.8k views
Kathleen asked Sep 29, 2014
7,772 views
The following relations are used to store data about students, courses, enrollment of students in courses and teachers of courses. Attributes for primary key in each rela...
45 45 votes
6 answers 6 answers
8.9k
8.9k views
Kathleen asked Sep 29, 2014
8,884 views
Let $\left(\{ p,q \},*\right)$ be a semigroup where $p*p=q$. Show that:$p*q=q*p$ and$q*q=q$
13 13 votes
3 3 answers
5.0k
5.0k views
Kathleen asked Sep 29, 2014
4,994 views
A stack is used to pass parameters to procedures in a procedure call.If a procedure $P$ has two parameters as described in procedure definition:procedure P (var x :intege...