index file Organization

12
Junaid Ali Siddiqui By

Transcript of index file Organization

Page 1: index file Organization

Junaid Ali Siddiqui

By

Page 2: index file Organization

In situations where we want to access a record directly without scanning all of the records, then we use indexed file organization.

Page 3: index file Organization

In this technique two separate files or tables are created to store records.

Master file Index file

Page 4: index file Organization

1) MASTER FILE: It is that table which contains actual data.

2) INDEX FILE: An index file is a table or other data structure

that holds addresses of other individual records of a file which contain only two data fields .

Primary key Storage address

Page 5: index file Organization

CONTINUE… Primary key uniquely identifies each record

and storage address show the secondary storage address where each record is stored.

There are two variation of an indexed file organization:

Sequential indexed Non sequential indexed

Page 6: index file Organization

Sequential index1. In such organization records are stored

sequentially by primary key value and a simple index that normally points to (address to ) a group of records.

2. It is faster than sequential organization, because here first we access an index file an find the address of record where it is stored, then we directly access it by visiting that address.

3. The master file contains data which is sequentially stored.

Page 7: index file Organization

CLASS # ST NAME SUBJECT MARKS2 Hina Jamil OOP 454 Uzma

KhanDLD 77

6 Asma Urooj

D.B 88

9 Zara Ahmad

D.S 33

MASTER FILE

Page 8: index file Organization

INDEX FILE

CLASS # Storage Address

2 10004 10046 10089 10015

Page 9: index file Organization

CONTINUE…

Now here if we want to search record having Class # 6 then first we access the index file from there we find the storage address of this records, when found, then directly goes to storage address= 1008, where record about “ Asma Urooj” will be stored.

Page 10: index file Organization

 ADVANTAGE:1.The basic advantage of index file it has a fast

speed.

DISADVANTAGE:Requires memory space because two files

are created.If an index fails to operate, the whole system

fails.

Page 11: index file Organization

MEESAGE LIFE is like a Riverwhich have many turnsso enjoy every TurnBecauseThese Turns neverReturns…

Page 12: index file Organization