- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.
- What is clustering Index in DBMS?
- Explain the concept of primary key with an example (DBMS)?
- What is the term serializability in DBMS?
- Difference Between Primary key and Foreign key in DBMS
- Explain the concept of secondary index in DBMS
- What is Decomposition in DBMS?
- What is 4NF in DBMS?
- What is RAID in DBMS?
- What is primary and secondary memory?
- What are the capabilities of DBMS and why relational DBMS is powerful?
- What is a database(dbms)?
- What is Multivalued Dependency (DBMS)?
- What is an instance in DBMS?
- What is Hierarchical model in DBMS?
- What is functional dependency in DBMS?