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
Critically evaluate the bulleted list of information-related items in this case study. How are each contradictory to the notion of being an information-literate knowledge worker?

What are stand-alone procedures? Procedures that are not part of a package are called as stand-alone because they independently defined. A good example of a stand-alone procedu

Evaluate, compare and contrast the two methods of relational database design namely top down method and Bottom up method. What will be your choice if you are asked to select a meth

Explain the terms primary key, candidate key, alternate key and secondary key. In the given table identify every key? STUDENT(SID,Regno, Name, City) Primary Key: The prim

Differentiate between logical database design and physical database design. Show how this separation leads to data independence? Basis Logical Databas

Determine the Derived attribute to avoid re-computation Each class box consists of an ordered list of attributes and operations, each represented as a next string. We can find

Design Of Distributed Databases: The distributed databases are mainly relational at local level. So a local database schema is the similar as that of a centralised database design

Explain the disadvantages of a file processing system? Ans: Disadvantages of File Processing Systems include: 1) Data Redundancy 2) Data Inconsistency 3) Difficult to acce

What are the two types of serializability? The two types of serializability is a)      Conflict serializability b)      View serializability

What is the main advantage of the object model? What are its different components? The object model focuses on the logical data structures. Each object model comprises of many