- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence
- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation
- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview
- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins
- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure
- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing
- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock
- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery
- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion
What are hashed files and indexed file organization(DBMS)?
Let us begin by understanding the hashed file organisation.
Hashed File Organisation
Hashed file organisation is also called a direct file organisation.
In this method, for storing the records a hash function is calculated, which provides the address of the block to store the record. Any type of mathematical function can be used as a hash function. It can be simple or complex.
Hash function is applied to columns or attributes to get the block address. The records are stored randomly. So, it is also known as Direct or Random file organization.
If the generated hash function is on the column which is considered as key, then the column can be called as hash key and if the generated hash function is on the column which is considered as non-key, then the column can be called as hash column.
Indexed file organisation
A record key is used in indexed file organisation to record the data. Record key is a unique ID which identifies a record and can also tell the sequence of the record.
Record key is present in a field which is contained in each record. A record key for a record may be an employee number.
Alternate indexes can also be in an indexed file system which means different arrangements of records can be accessed by the same record keys.
For example, files can be accessed through the employee department rather than employee ID.
Advantages of indexed over hash
The advantages of indexed file organisation over hashed file organisation are as follows −
In indexed file organisation, data records can be easily processed, unlike hashed file organisation in which data is stored randomly and is a big mess.
Multiple records can be accessed using the same key in indexed file organisation while this is not the case with hashed file organisation.
Advantages of hash over indexed
The advantages of hashed file organization over indexed file organization are as follows −
In hashed file organization, the records need not be sorted after any transaction. While in an indexed file organization the reorganization needs to be done from time to time to get rid of deleted records.
There is an extra cost to maintain index in indexed file organization, while this is not the case in hashed file organization.
- Related Articles
- What is the role of file organization modules for typical file system software(DBMS)?
- Differentiate between OS and DBMS files and OS and DBMS buffer manager
- Distinguish between flat files and databases (dbms)?
- What are the capabilities of DBMS and why relational DBMS is powerful?
- State the difference between file systems and DBMS?
- What are the text files and binary files in C language?
- What is Line and Staff Organization?
- What are the levels of computer system organization?
- How are files added to a tar file using Python?
- How are files added to a zip file using Python?
- How are files extracted from a tar file using Python?
- Are arrays zero indexed in C#?
- What are the arithmetic and character operators in DBMS?
- What are the responsibilities an Accountant in an organization?
- What are the risk control measure for an organization?