- 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 is the primary index in DBMS?
In the primary index there is a one-to-one relationship between the entries in the index table and records in the main table. Primary index is used on a primary key.
Types of Primary Index
Primary index are of two types, which are as follows −
Dense Primary Index
In a dense primary index an index record appears for every search key value in the main table that means each and every record in the main table has an entry in the index.
Given below is an example of dense primary index −
A pointer stores the address of a record.
Non-Dense / Sparse Primary index
An index record appears as limited or for some of the values in the file.
For large tables the dense primary index itself begins to grow in size. To keep the size of the index smaller, instead of pointing to each and every record in the main table, the index points to the records in the main table in a gap.
Given below is an example of non-dense primary index −
As we can see, the record is divided into several blocks, each containing a fixed number of records. In the above example each table contains 10 records. The pointer in the index table points to the first record of each block.
If you are searching for roll 14, the index is first searched to find out the highest entry which is smaller than or equal to 14. We have 11. The pointer leads us to roll 11 where a sequential search is made to find out roll 14.
- Related Articles
- What is clustering Index in DBMS?
- Difference Between Primary key and Foreign key in DBMS
- Explain the concept of primary key with an example (DBMS)?
- Explain the concept of secondary index in DBMS
- What is the term serializability in DBMS?
- What is Decomposition in DBMS?
- What is 4NF in DBMS?
- What is RAID in DBMS?
- What is functional dependency in DBMS?
- What is Transitive dependency in DBMS?
- What is an instance in DBMS?
- What is Hierarchical model in DBMS?
- What is Data Independence in DBMS?
- What is multivalued dependency in DBMS?
- What is heuristic optimization in DBMS?