in Databases edited by
651 views
0 votes
0 votes

In this Question :- 

Let there is a Table named Stud_records  with 3000 records of fixed length , each record size is 50 Bytes and records are stored in a block of size 512 Bytes , If secondary index is built on the key field of size 10 Bytes and a block pointer of size 5 Bytes , then the number of first level index blocks are ______

My Solution :- (According to https://gateoverflow.in/259/gate2008-70 )

Total Records = 3000

Hence The number of blocks in secondary Index = (3000 * 15)/512 = 88 Blocks

The number of blocks in First level index = (88 * 15)/512 = 3   ????  

Why am i wrong ?? Please Help?

in Databases edited by
by
651 views

2 Comments

Is it a GO Exam question?
I am not able to see it.
0
0
OK Hold on mam
0
0

1 Answer

2 votes
2 votes
Best answer

In the first level, there will be an entry for each record of the file.
Total Records = 3000
Size of each record = 50 B
Block size = 512 B
Index record size = 10+5 = 15 B
Records per block$\left \lfloor \frac{512}{15} \right \rfloor$ = 34
The number of blocks in First level index = $\left \lceil \frac{3000}{34} \right \rceil$ = 89

selected by

4 Comments

Oh i see now whats goin' on. So the method i used didnt worked here becuase there the records were Unspanned i.e. totally got fit it one block,but here due to spanning of records it didnt work Isnt it ?

And one more thing to Question:-

In OS when we talk about multi level Page table then the Heirerchy is like :-

Say in two level Page table:

 First Level ---> Second Level--->Frames

But in indexing Case:

Second Level ---> First Level ---> Records

Am i right?
0
0

Oh i see now whats goin' on. So the method i used didnt worked here because there the records were Unspanned i.e. totally got fit it one block,but here due to spanning of records it didnt work Isnt it ?

Yes. Exactly. 

For 2nd question - You can say this.  

1
1
Thanku So Much
0
0

Related questions