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

ER Diagram, Hi I have got an assignment for making an er diagram for market...

Hi I have got an assignment for making an er diagram for market management software can any budy help me?

Dataset, The dataset " CFOLYMPICS.XLS " contains the observations used in t...

The dataset " CFOLYMPICS.XLS " contains the observations used in the above article.  The definitions of the variables are also included in this spreadsheet.  However, for the purpo

Which is a valid sql type, Which is a valid SQL type? A valid SQL Shoul...

Which is a valid SQL type? A valid SQL Should be in CHARACTER it is should be NUMERIC and FLOAT.

Convert erd to rdm model, Regional Gardens has many nurseries, including Wa...

Regional Gardens has many nurseries, including Wagga Wagga, Bathurst, Albury, Orange, and Dubbo. Each nursery is known by its campus code, eg WW, B, A, O and D respectively. Additi

What are object interaction diagrams, What are object interaction diagrams?...

What are object interaction diagrams? Object interaction diagrams are the diagrams that used to describe order in which messages are communicated in execution of an operation,

Explain er model, Question 1 Explain ER model Question 2 What are the...

Question 1 Explain ER model Question 2 What are the characteristics of a computer provided information? Question 3 What are facts and guidelines to be considered when se

Lock, lock and types of lock

lock and types of lock

Database problem in wordpress, Project Description: I am having a random...

Project Description: I am having a random problem with my Wordpress site. If I click on "Publish" and "Add new", it takes me to a 404 page not found of /wp-admin/post.php (th

Client dbms, i need to submit in this topic.

i need to submit in this topic.

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