You are on page 1of 14

UNIVERSITY INSTITUTE OF

ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE
AND ENGG.

Bachelor of Engineering (Computer Science & Engineering)


DATA STRUCTURES 21CSH-211

DISCOVER . LEARN . EMPOWER


1
FILE ORGANIZATION
Indexed sequential file
• Each record of a file has a key field which uniquely identifies that
record.
• An index consists of keys and addresses.
• An indexed sequential file is a sequential file (i.e. sorted into order of
a key field) which has an index.
• A full index to a file is one in which there is an entry for every record.
Indexed sequential file
Indexed sequential file
• Indexed sequential files are important for applications where data
needs to be accessed.....
• sequentially
• randomly using the index.
Indexed sequential file
• An indexed sequential file can only be stored on a random access
device
e.g. magnetic disc, CD.
Advantages
• Provides flexibility for users who need both type of accesses with the
same file
• Faster than sequential
Disadvantages
• Extra storage space for the index is required
Indexed sequential access file organization

• Indexed sequential access file combines both sequential file and


direct access file organization.
• In indexed sequential access file, records are stored randomly on a
direct access device such as magnetic disk by a primary key.
• This file have multiple keys. These keys can be alphanumeric in
which the records are ordered is called primary key.
• The data can be access either sequentially or randomly using the
index. The index is stored in a file and read into memory when the
file is opened.

9
Advantages of Indexed sequential access file
organization
• In indexed sequential access file, sequential file and random file
access is possible.
• It accesses the records very fast if the index table is properly
organized.
• The records can be inserted in the middle of the file.
• It provides quick access for sequential and direct processing.
• It reduces the degree of the sequential search.

10
Disadvantages of Indexed sequential access
file organization
• Indexed sequential access file requires unique keys and periodic
reorganization.
• Indexed sequential access file takes longer time to search the index
for the data access or retrieval.
• It requires more storage space.
• It is expensive because it requires special software.
• It is less efficient in the use of storage space as compared to other
file organizations.

11
Inverted files
• Inverted files are similar to multilists. Multilists records with the
same key value are linked together with link information being kept
in individual record. In case of inverted files the link information is
kept in index itself.
• EG. We assume that every key is dense. Since the index entries are
variable length, index maintenance becomes complex fro multilists.
Benefits being Boolean queries require only one access per record
satisfying the query. Queries of type k1=xx and k2=yy can be
handled similarly by intersecting two lists.

12
• The retrieval works in two steps. In the first step, the indexes are processed to
obtain a list of records satisfying the query and in the second, these records are
retrieved using the list. The no. of disk accesses needed is equal to the no. of
records being retrieved + the no. to process the indexes.
• Inverted files represent one extreme of file organization in which only the index
structures are important. The records themselves can be stored in any way.
• Inverted files may also result in space saving compared with other file
structures when record retrieval doesn’t require retrieval of key fields. In this
case key fields may be deleted from the records unlike multilist structures.

13
THANK YOU

14

You might also like