0% found this document useful (0 votes)
21 views4 pages

TOPIC-2 File Organization

The document discusses three file organization methods: Indexed, Hash, and Sequential. Indexed files allow for easy updates and linking of records but require additional space and are more expensive, while Hash files enable fast access and updates using a hash function but also require extra space. Sequential files store records in a continuous order and are space-efficient but provide slow access as they can only be accessed sequentially.

Uploaded by

Amol Khalkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

TOPIC-2 File Organization

The document discusses three file organization methods: Indexed, Hash, and Sequential. Indexed files allow for easy updates and linking of records but require additional space and are more expensive, while Hash files enable fast access and updates using a hash function but also require extra space. Sequential files store records in a continuous order and are space-efficient but provide slow access as they can only be accessed sequentially.

Uploaded by

Amol Khalkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

File Organization Methods

3. Indexed File Organization:


 In an indexed file organization, the rows are stored either
sequentially or non sequentially, and an index Is created that
allows the application software to locate individual rows.
 A sequential file that is indexed called an Indexed sequential file.
Advantages
1. In this file organization linking of the records of two files are
possible.
2. Updating of files are easy as compare to other file organization
Disadvantages
1. Additional space required for indexes so more space requires
than sequential file organization.
2. This file organization are expensive because it is stored on direct
access device
File Organization Methods
4. Hash File Organization:
 The records are stored randomly. So, it is also known as Direct or
Random file organization.
 A random file has records that are stored and retrieved according
to their disk address or their relative position within the file.
 In this method, for storing/retrieving the records a hash function is
used to calculate the address of the block to store/retrive the
record.
 Any type of mathematical function can be used as a hash function.
File Organization Methods
4. Hash File Organization:
Advantages
1. The file accessing and updating becomes very easy, simple, and
fast.
2. Suitable for access of online applications.
Disadvantages
1. Additional space required for indexes so more space requires
than sequential file organization.
2. This file organization are expensive because it is stored on direct
access device
Sequential File Organization Indexed File Organization Relative(Hash) File Organization
These files can be accessed
These files can be accessed
These files can be accessed only sequentially as well as randomly
sequentially as well as randomly
sequentially. with the help of their relative
with the help of the record key.
record number.

The records are stored based on the


The records are stored The records are stored by their
value of the RECORD-KEY which is
sequentially. relative address.
the part of the data.

Records can be only be stored at It is possible to store the records in The records can be inserted at any
the end of the file. the middle of the file. given position.

It occupies less space as the


records are stored in continuous It occupies more space. It occupies more space.
order.

It also provides slow access(but is


It provides slow access, as in order It provides fast access as provides
fast as compared to sequential
to access any record all the previous the record key compared to the
access) as it takes time to search for
records are to be accessed first. other two.
the index.

There is no need to declare any KEY One or more KEYS can be created Only one unique KEY is declared
for storing and accessing the for storing and accessing the for storing and accessing the
records. records. records.

You might also like