0% found this document useful (0 votes)
11 views12 pages

Introduction To Indexing in Database Management Systems Print

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

Introduction To Indexing in Database Management Systems Print

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

DATABASE MANAGEMENT SYSTEM

PRESENTATION

Indexing And Its Types Of Orderd


Indices

By:
Abishek .B
Monish Kanna.M
Ravikumar.D
Thiruneelin.V.P
Why Indexing?
This is
Indexing

Data Structure Technique Which Allows You To Quickly


Retrieve Records From A Database File.

Finds the block in which record resides


Fetch the
Index details
Structure of
indexing

•Consists of two columns created from


database columns
•Search Key - contains a copy of the primary
key or candidate key of the table
Data Reference or Pointer - contains a set of
pointers holding the address of the disk block
where that parti
Types of Ordered Indices
Ordered Indices

•The indices are usually sorted to make searching faster.


•The indices which are sorted are known as ordered indices.
•records in the indexed file may themselves be stored in some sorted order,
just as books in a library
•file may have several indices, on different search keys
•If the file containing the records is sequentially ordered, a clustering index is an
index whose search key also defines the sequential order of the file
Primary Index
A primary index is a fundamental feature in a database that ensures each record in a table is
uniquely identifiable, preventing duplicate entries. It is inherently linked to the primary key, which
serves as a unique identifier for each record. By enforcing uniqueness, a primary index maintains
data integrity and ensures efficient data management.

For instance, in a customer database, the customer ID can act as the primary key, guaranteeing
that every customer has a unique identifier. This uniqueness simplifies searching, updating, and
managing records, as each entry can be directly referenced without ambiguity. The primary index
plays a critical role in organizing data and optimizing database operations, enabling faster lookups
and ensuring consistent data relationships across the system.
Dense and Sparse Indexes
Dense Index Sparse Index
A dense index stores an A sparse index stores only a
index entry for every record selected subset of the table's
in the database table. This records, often for specific key
allows for quick searches and values. It is more space-
efficient retrieval of data. efficient but may not be as
However, it can consume performant for all queries.
more storage space. Imagine Think of a book index with
a book index where every only a few key terms listed,
single word is listed, making making it concise but
it comprehensive but bulky. potentially limiting in its
scope.
Clustered Index
A clustered index is a special type of index that physically orders the
data in a database table based on the index key. This means that the
data rows are stored in the same order as the index values. It's like a
physical index in a book, where the pages are arranged alphabetically
based on the index entries. This structure makes data retrieval for the
indexed column very efficient, as the data is already sorted.
Secondary Indexes

Non-Unique Multiple Indexes Faster Retrieval


A secondary index can be created on A database table can have multiple Secondary indexes speed up data
any column in a database table. It's secondary indexes. This allows for retrieval for specific columns. By
non-unique, meaning multiple records flexible and efficient data retrieval creating an index on frequently used
can share the same value for that based on various search criteria. For columns, you can improve the
column. For instance, a customer instance, in a product database, you efficiency of queries involving those
database might have a secondary might have secondary indexes for columns, making database
index on the city column, allowing you product name, category, and price, interactions more responsive and
to efficiently retrieve all customers enabling you to query data based on user-friendly.
residing in a particular city. any of these attributes.
Advantages and Disadvantages of Indexing
Advantages Disadvantages

• Faster data retrieval for queries • Increased storage space requirements


• Improved query performance and efficiency • Potential performance overhead for updates and inserts
• Enhanced database responsiveness and user experience • Complexity in managing and maintaining indexes
• Support for unique key constraints and data integrity • Potential for over-indexing, leading to decreased
performance
Conclusion
• Indexing plays a vital role in improving the performance of
database queries by allowing quick data retrieval. Ordered
indices, which store data in a sorted sequence, enhance the
efficiency of searches, insertions, and deletions. Common types
of ordered indices include B-trees, which provide a balanced
structure for fast operations; B+ trees, an optimized version of B-
trees suitable for range queries; and binary search trees, which
are simpler but less efficient for large datasets. These indices
are essential for optimizing query performance, especially when
dealing with range-based searches and ordered data retrieval.

You might also like