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

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

Posted Date: 3/8/2013 6:09:28 AM | Location : United States







Related Discussions:- How many block accesses average saved on using secondryindex, Assignment Help, Ask Question on How many block accesses average saved on using secondryindex, Get Answer, Expert's Help, How many block accesses average saved on using secondryindex Discussions

Write discussion on How many block accesses average saved on using secondryindex
Your posts are moderated
Related Questions
what are the states of transaction?

3NF Normal Form A relation schema R is in 3NF if it is in 2NF and for each FD X A either of the following is true X is a Super-key of R. A is a prime attribute of R

differences between a classified catalog and a dictionary catalog

What are the advantages of object ID? The main advantages of Object IDs are as below: i) IDs are not changing  ii) IDs are completely independent of the changes in data v

Describe Query evaluation engine? Query Evaluation engine: Vehicle executes low-level instructions obtained through the DML compiler. The Storage Manager Components gives in

A database to track your progress in your college program will track your progress towards graduation! A database that has information containing the classes that you have taken, c

The database depicted in the Visio diagram describes Proceeding , Article , Researcher , article PublishedIn a proceeding, article WrittenBy researchers and proceedings Edi

Project Description: I am updating my Javascript + HTML website with five domains for the same website I would like to know if I want to create site map and submit it in all the

A buyer for a large department store chain must place orders with an athletic shoe manufacturer six months prior to the time the shoes will be sold in the department stores. In par

What is a view?  Make a view of EMP table named DEPT 20, to display the employees in department 20 and their annual salary.  Ans:  View is a virtual table that does not consist