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

Concatenation operator-data manipulation language, Concatenation operator ...

Concatenation operator Example : Printing name and job as one string as column name employees: SELECT ENAME||JOB "EMPLOYEES" FROM EMP;

Give a sample of the dynamic model, Give a sample of the Dynamic Model. ...

Give a sample of the Dynamic Model. The sample of dynamic model is given below:  Dynamic model for the car: Brake and Accelerator            Brake or Applies Accelerator

Define the terms entity type and entity set, Define the terms i) Entity typ...

Define the terms i) Entity type ii) Entity set Entity type: An entity type describes a collection of entities that have the similar attributes. Entity set: The set of all en

Data base design for a museum information system, In this practical assignm...

In this practical assignment, we will run through a complete database application development cycle, starting with the schema design, from an initial data import to database applic

Hashing.., various techniques of hashing?

various techniques of hashing?

With the help of a diagram defines typical element modules, With the help o...

With the help of a diagram defines the typical element modules of a DBMS? The functional elements of a database system can be widely divided into: 1) Storage manager and 2) q

Explain the components of database system in details., Explain the compone...

Explain the components of Database System in details.

Three level architecture of dbms-logical architecture, Three Level Architec...

Three Level Architecture of DBMS or Logical DBMS Architecture The logical architecture defines how data in the database is perceived by users. It is not deals with how the da

What is explicit update, What is Explicit update In explicit update,...

What is Explicit update In explicit update, each derived attribute is defined with respect to one, or more fundamental base object(s). The object designer determines that de

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