How many block accesses average saved on using secondryindex, Database Management System

Assignment Help:

An un- ordered student file has 20,000 records stored on a disk having the Block size as 1 K. Suppose that each student record is of 100 bytes, the secondary index field is of 8 bytes, and block pointer is also of 8 bytes, find how many block accesses on average may be saved on using secondary index on enrolment number.

Answer:

Number of accesses without using Secondary Index:

Number of records in the file = 20000

Block size = 1024 bytes

Record size = 100 bytes

Number of records per block = integer value of [1024 / 100] = 10

Number of disk blocks acquired by the file = [Number of records / records per block]

= [20000/10] = 2000

 

As the file is un-ordered any search on an average will require about half of the above blocks to be accessed. Thus, average number of block accesses = 1000

Number of accesses with Secondary Index:

Size of an index entry = 8+8 = 16 bytes

Number of index entries that can be stored per block

= integer value of [1024 / 16] = 64

Number of index entries = number of records = 20000

Number of index blocks = ceiling of [20000/ 64] = 320

Number of index block transfers to find the value in index blocks = ceiling of [log2320] = 9

One block move will be needed to get the data records using the index pointer after the needed index value has been located. So total number of block transmits with secondary index = 9 + 1 = 10

Therefore,, the Secondary index would save about 1990 block transmit for the given case. This is a huge saving compared to primary index. Please also compare the size of secondary index to primary index.

Let us now see an illustration of a secondary index that is on an attribute that is not an alternate key.

 

 

 

 

                                269_how many block accesses average saved on using Secondryindex.png


Related Discussions:- How many block accesses average saved on using secondryindex

Higher normal forms, Higher Normal Forms Is there more normal forms beyond...

Higher Normal Forms Is there more normal forms beyond BCNF? Yes, though, these normal forms are not based on the concept of functional dependence. More normalisation is needed if

OLAP CUBES, 1) Define a job scheduling strategy that will meet business req...

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Data handling and research methods, Data Handling and Research Methods: ...

Data Handling and Research Methods: The dataset encompassing 130 participants contains several variables measuring detrimental health related behaviours referring to the use o

Write a short note on participation role, write a short note on participati...

write a short note on participation role? Participation role: roles are indicating in E-R diagram by labelling the lines that connect diamonds to rectangles.

MYSQL, i have a homework assignment identical to one you have listed

i have a homework assignment identical to one you have listed

What is inheritance, What is inheritance? Define it in detail?  Inheri...

What is inheritance? Define it in detail?  Inheritance Inheritance can be at the levels of types, or at the level of tables we first consider inheritance of types, then i

Project on designing and creating a database , This project will involve de...

This project will involve designing and creating a database for an organization.  In the design of a database, there is no single "perfect" design.  So your database design may not

What is the difference between serial and sequential files, What is the dif...

What is the difference between serial and sequential files? How searching is applied on both?    Ans: A serial file is one where the records have been stored in the order where

Data Relation diagram, Can you assist me in Database management system? I n...

Can you assist me in Database management system? I need help in my courses, please email me at and get back me soon...

Constraints violation during insertion, If the insertion violates one or mo...

If the insertion violates one or more constraints, then two alternatives are available: Default option: - Insertion can be discarded and the reason of refusal can also be ex

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd