1,476 views
0 votes
0 votes
Consider file consists of 10,000 records. Block size 1024 bytes, record size 100 bytes. search key 9 bytes, pointer 7 byte.

a) How many 1st level index blocks using dense indexing.

b)How many 1st level index blocks using sparse indexing.

please explain in detail diff bw sparse and dense.

1 Answer

Best answer
2 votes
2 votes

In dense index, there is an index record for every search key value in the database. This makes searching faster but requires more space to store index records itself. Index records contain search key value and a pointer to the actual record on the disk.

In sparse index, index records are not created for every search key. An index record here contains a search key and an actual pointer to the data on the disk. To search a record, we first proceed by index record and reach at the actual location of the data. If the data we are looking for is not where we directly reach by following the index, then the system starts sequential search until the desired data is found.

you can read more from here

http://www.cs.sfu.ca/CourseCentral/354/zaiane/material/notes/Chapter11/node5.html

1st calculate

block factor for DB file = (B-H)/R = (1024-0)/100 = 10 (take floor value)

block factor for index file =(B-H)/(K+P) = (1024-0)/(9+7) =64

a) How many 1st level index blocks using dense indexing.

10,000/64 = 157 (take ceiling value)


b)How many 1st level index blocks using sparse indexing.

no. of blocks of DB = 10,000/10 =1000

so no. of sparse index blocks = 1000/64 = 16 (take ceiling value)

selected by

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
1 answer
3
vishnu777 asked Nov 8, 2022
391 views
Can anyone explain in detail about the concepts of sencondary indexing in dbms??
0 votes
0 votes
0 answers
4
Purple _ rain asked Sep 3, 2022
136 views
What is fanout ratio