SlideShare a Scribd company logo
DATABASE INDEXING
• Indexing is used to optimize the performance of a
database by minimizing the number of disk accesses
required when a query is processed.
• The index is a type of data structure. It is used to locate
and access the data in a database table quickly.
• Indexes are a powerful tool used in the background of
a database to speed up querying. They provide a
method to quickly look up the requested data.
• Simply put, an index is a pointer to data in a table. An
index in a database is very similar to an index in the
back of a book.
WHY ARE INDEXES NEEDED?
• Imagine walking into the Library of Congress and being given the task
of finding a specific publishing within 10 minutes. Would you be able
to complete this task within the given time frame?
• The Library of Congress houses approximately 170 million items. The
first thing one would do is access the library’s index because indexes
contain all the necessary information needed to access items quickly
and efficiently.
• Similarly, a database index contains all the necessary information to
access data quickly. Some tech giants process hundreds of petabytes of
data per day, and efficient access is crucial. Indexes serve as lookup
tables that store data efficiently for quicker retrieval.
INDEX STRUCTURE
• 1. Search Key - Contains a copy of the primary key
or candidate key of the table. These are stored in
sorted order.
• 2. Data Reference - Contains pointers holding the
address of the disk block where the value of the
key can be found.
INDEXING METHODS
1. ORDERED INDICES
• To enhance search efficiency, indices are often sorted for
faster retrieval.
Example
• Consider a table of employees with thousands of records,
where each record is 10 bytes in size. Suppose employee IDs
start sequentially from 1, 2, 3, and so on.
– Without an index: The database must scan sequentially until it
reaches ID 543, reading 543 × 10 = 5,430 bytes.
– With an index: If each index entry is 2 bytes, the DBMS only needs
to read 542 × 2 = 1,084 bytes, making the search much faster.
2. PRIMARY INDEX
• If an index is created using the primary key of
a table, it is called Primary Indexing.
• These primary keys are unique, and searching
performance is efficient.
• Primary indexes can be:
1. Dense Index
2. Sparse Index
2. PRIMARY INDEX
1. Dense Index - Contains an index record for
every search key value. Faster searching but
requires more space.
2. PRIMARY INDEX
2. Sparse Index - Index records appear for only
some values, reducing space usage but requiring
additional sequential searching.
3. CLUSTERING INDEX
• A Clustering Index is used when an index is
created on non-primary key columns that may
not be unique. A combination of columns is
used to form a unique index.
• Example: Employees grouped by Dept_ID form
clusters, and the index points to the entire
cluster instead of individual records.
CLUSTERED INDEX
SECONDARY INDEX
• As table size grows, mapping in a sparse index
also grows. Secondary indexing introduces
another level of indexing to improve
efficiency.
- The first level index maps broad ranges
and is stored in primary memory.
- The second level index further divides
ranges and is stored in secondary memory.
SECONDARY INDEX
• Searching for Roll No. 111:
• Find the highest entry ≤ 111
in Level 1 (gets 100).
• In Level 2, find the highest ≤
111 (gets 110).
• Using address 110, search
the data block until Roll No.
111 is found.
• This hierarchical structure
improves search efficiency.
END

More Related Content

Similar to Database_Indexing_AND ITTS TYPES PRESENTATION (20)

PDF
Indexing techniques
Huda Alameen
 
PDF
Db lec 08_new
Ramadan Babers, PhD
 
PPTX
Indexing the MySQL Index: Key to performance tuning
OSSCube
 
PPTX
presentation is on database for sql and stored procedures
harshsinghal08979
 
PPS
07 qmds2005 session10
Niit Care
 
PPTX
Database Management System-Module-IV(part-1).pptx
AiswaryaMohan31
 
PPTX
Indexing Data in data Warehouse presentation.pptx
PratapDas26
 
PPTX
File Organization in database management.pptx
ubaidullah75790
 
PPTX
Database indexing techniques
ahmadmughal0312
 
PPTX
Indexing
myrajendra
 
PPTX
Sql server ___________session_17(indexes)
Ehtisham Ali
 
PPT
Indexing Strategies
jlaspada
 
PPT
Data indexing presentation
gmbmanikandan
 
PPTX
Sql performance tuning
Leo Mark Villar
 
PDF
MySQL INDEXES
HripsimeGhaltaghchya
 
PPT
Sydney Oracle Meetup - indexes
paulguerin
 
PDF
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
Hemant Kumar Singh
 
PDF
Mysql query optimization
Baohua Cai
 
PPT
Lecture 26
Shani729
 
PPTX
Query Optimization in SQL Server
Rajesh Gunasundaram
 
Indexing techniques
Huda Alameen
 
Db lec 08_new
Ramadan Babers, PhD
 
Indexing the MySQL Index: Key to performance tuning
OSSCube
 
presentation is on database for sql and stored procedures
harshsinghal08979
 
07 qmds2005 session10
Niit Care
 
Database Management System-Module-IV(part-1).pptx
AiswaryaMohan31
 
Indexing Data in data Warehouse presentation.pptx
PratapDas26
 
File Organization in database management.pptx
ubaidullah75790
 
Database indexing techniques
ahmadmughal0312
 
Indexing
myrajendra
 
Sql server ___________session_17(indexes)
Ehtisham Ali
 
Indexing Strategies
jlaspada
 
Data indexing presentation
gmbmanikandan
 
Sql performance tuning
Leo Mark Villar
 
MySQL INDEXES
HripsimeGhaltaghchya
 
Sydney Oracle Meetup - indexes
paulguerin
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
Hemant Kumar Singh
 
Mysql query optimization
Baohua Cai
 
Lecture 26
Shani729
 
Query Optimization in SQL Server
Rajesh Gunasundaram
 

Recently uploaded (20)

PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
July Patch Tuesday
Ivanti
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
July Patch Tuesday
Ivanti
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Ad

Database_Indexing_AND ITTS TYPES PRESENTATION

  • 1. DATABASE INDEXING • Indexing is used to optimize the performance of a database by minimizing the number of disk accesses required when a query is processed. • The index is a type of data structure. It is used to locate and access the data in a database table quickly. • Indexes are a powerful tool used in the background of a database to speed up querying. They provide a method to quickly look up the requested data. • Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index in the back of a book.
  • 2. WHY ARE INDEXES NEEDED? • Imagine walking into the Library of Congress and being given the task of finding a specific publishing within 10 minutes. Would you be able to complete this task within the given time frame? • The Library of Congress houses approximately 170 million items. The first thing one would do is access the library’s index because indexes contain all the necessary information needed to access items quickly and efficiently. • Similarly, a database index contains all the necessary information to access data quickly. Some tech giants process hundreds of petabytes of data per day, and efficient access is crucial. Indexes serve as lookup tables that store data efficiently for quicker retrieval.
  • 3. INDEX STRUCTURE • 1. Search Key - Contains a copy of the primary key or candidate key of the table. These are stored in sorted order. • 2. Data Reference - Contains pointers holding the address of the disk block where the value of the key can be found.
  • 5. 1. ORDERED INDICES • To enhance search efficiency, indices are often sorted for faster retrieval. Example • Consider a table of employees with thousands of records, where each record is 10 bytes in size. Suppose employee IDs start sequentially from 1, 2, 3, and so on. – Without an index: The database must scan sequentially until it reaches ID 543, reading 543 × 10 = 5,430 bytes. – With an index: If each index entry is 2 bytes, the DBMS only needs to read 542 × 2 = 1,084 bytes, making the search much faster.
  • 6. 2. PRIMARY INDEX • If an index is created using the primary key of a table, it is called Primary Indexing. • These primary keys are unique, and searching performance is efficient. • Primary indexes can be: 1. Dense Index 2. Sparse Index
  • 7. 2. PRIMARY INDEX 1. Dense Index - Contains an index record for every search key value. Faster searching but requires more space.
  • 8. 2. PRIMARY INDEX 2. Sparse Index - Index records appear for only some values, reducing space usage but requiring additional sequential searching.
  • 9. 3. CLUSTERING INDEX • A Clustering Index is used when an index is created on non-primary key columns that may not be unique. A combination of columns is used to form a unique index. • Example: Employees grouped by Dept_ID form clusters, and the index points to the entire cluster instead of individual records.
  • 11. SECONDARY INDEX • As table size grows, mapping in a sparse index also grows. Secondary indexing introduces another level of indexing to improve efficiency. - The first level index maps broad ranges and is stored in primary memory. - The second level index further divides ranges and is stored in secondary memory.
  • 12. SECONDARY INDEX • Searching for Roll No. 111: • Find the highest entry ≤ 111 in Level 1 (gets 100). • In Level 2, find the highest ≤ 111 (gets 110). • Using address 110, search the data block until Roll No. 111 is found. • This hierarchical structure improves search efficiency.
  • 13. END