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

Assignment Help:

Example 1: An ordered student file (ordering field is enrolment number) has 20,000 records stored on a disk having the Block size as 1 K. Assume that each student record is of 100 bytes, the ordering 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 primary index.

Answer:

Number of accesses without using Primary 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

Suppose a block level binary search, it would require log22000 = about11 block accesses.

Number of accesses with Primary 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 disk blocks = 2000

Number of index blocks = ceiling of [2000/ 64] = 32

Number of index block transfers to find the value in index blocks = log232 = 5

One block transfer 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 primary index = 5 + 1 = 6.

Therefore, the Primary index would save about 5 block transmits for the given case.

Are there any drawbacks of using primary index? Yes, a primary index needs the data file to be ordered, this causes troubles during deletion and insertion of records in the file. This difficulty can be taken care of by selecting a suitable file organisation that permits logical ordering only. 


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

List out user authorization to modify the database schema, List out various...

List out various user authorization to modify the database schema. a)  Index authorization b)  Resource authorization c)  Alteration authorization d)  Drop authorizat

What is known as fudge factor, What is known as fudge factor? The numbe...

What is known as fudge factor? The number of partitions is enhanced by a small value called the fudge factor, which is usually 20 percent of the number of hash partitions compu

Differentiate oo development from structured development., Differentiate OO...

Differentiate OO development from structured development. Structured approach of problem solving is based upon the idea of decomposition of system into subsystem. In this appro

What are the situations while dbms should not be used, What are the situati...

What are the situations while DBMS should not be used? DBMS should not be used in situations like: (i) No need of security. (ii) Not difficulty to access the data (iii) N

Determine the subsystem design issue, Determine the Other System Design Iss...

Determine the Other System Design Issue How to realise subsystems; through hardware or software? How is object model mapped on chosen hardware software? Mapping

Decompose the table with the functional dependencies, Decompose the table w...

Decompose the table with the following description and functional dependencies into a set of equivalent tables normalized to 3NF or BCNF. This database stores records from a (ve

What are costs to be considere when transaction is roll back, What are the ...

What are the costs to be considered when a transaction has to be rolled back when recovering from deadlock?         Ans: A few transaction will must rolled back (made a victim)

In case of entity integrity the primary key may be declared, In case of ent...

In case of entity integrity, the primary key may be declared? In a case of entity integrity primary key may be not Null.

What is meant by heuristic optimisation, What is meant by heuristic optimis...

What is meant by heuristic optimisation?Discuss the major heuristics that are applied during query optimisation.

The proliferation of object-oriented methods, The Proliferation of Object-O...

The Proliferation of Object-Oriented Methods The first few years of the 1990s saw blossoming of around fifty various object oriented methods. This proliferation is a sign of g

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