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

Give an example of operations from the state actions, Give an example of op...

Give an example of operations from the State Actions and Activities. For instance, in bank the activity verify account code and verify password

What is oracle process explain for processes of oracle, What is Oracle Proc...

What is Oracle Process? Explain any four processes started by Oracle. Oracle Process is as follows: SMON: The System Monitor carries out a crash recovery while a crashed in

Write short notes on domain relational calculus, Write short notes on domai...

Write short notes on domain relational calculus   The domain relational calculus uses domain variables that take on values from an attribute domain rather than values for whole

Create a view that finds the student name, Section A:  Use the following ta...

Section A:  Use the following tables to create a database called College.  Use SQL commands. Student stuid(primary) lastName firstName

Give concurrent sub states diagram for the classroom, Give Concurrent sub s...

Give Concurrent sub states diagram for the classroom and exam held. In Figure, simultaneous substrates have been taken. After passing Minor 1 test you could give Minor 2 test. T

Give the reasons for allowing concurrency, Give the reasons for allowing co...

Give the reasons for allowing concurrency? The reasons for allowing concurrency is if the transactions run serially, a short transaction might have to wait for a preceding long

DBMS, give some example real life situation where DBMS are most suitable

give some example real life situation where DBMS are most suitable

Define what Immediate database modification technique uses, Define what Imm...

Define what Immediate database modification technique uses?  Ans: Both undo and redo.

What are decision support systems, Question: (a) What are decision sup...

Question: (a) What are decision support systems, and what role do they play in the business environment? (b) Data mining is a knowledge discovery process of automated extr

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