SlideShare a Scribd company logo
Indexing Techniques
Assistant Lecturer Huda A. Alameen
hudaa.alameen@uokufa.edu.iq
Indexing Techniques
 A database index is a data structure that improves the speed of data retrieval
operations on a database table at the cost of slower writes and increased storage
space. Indexes can be created using one or more columns of a database table,
providing the basis for both rapid random lookups and efficient access of ordered
records.
 In a relational database, an index is a copy of one part of a table. Some databases
extend the power of indexing by allowing indices to be created on functions or
expressions. For example, an index could be created on upper(last_name), which
would only store the upper case versions of the last_name field in the index.
Index architecture :Non-clustered
 The data is present in arbitrary order, but the logical ordering is specified by the
index. The data rows may be spread throughout the table regardless of the value
of the indexed column or expression. The non-clustered index tree contains the
index keys in sorted order, with the leaf level of the index containing the pointer
to the record (page and the row number in the data page in page-organized
engines; row offset in file-organized engines).
 In a non-clustered index:
1.The physical order of the rows is not the same as the index order.
2.Typically created on non-primary key columns used in JOIN, WHERE, and ORDER BY
clauses.
 There can be more than one non-clustered index on a database table.
Index architecture :Clustered
 Clustering alters the data block into a certain distinct order to match the index,
resulting in the row data being stored in order. Therefore, only one clustered
index can be created on a given database table. Clustered indices can greatly
increase overall speed of retrieval, but usually only where the data is accessed
sequentially in the same or reverse order of the clustered index, or when a range
of items is selected.
Cluster
 When multiple databases and multiple tables are joined, it's referred to as a
cluster (not to be confused with clustered index described above). The
records for the tables sharing the value of a cluster key shall be stored
together in the same or nearby data blocks. This may improve the joins of
these tables on the cluster key, since the matching records are stored
together and less I/O is required to locate them.The data layout in the tables
which are parts of the cluster is defined by the cluster configuration. A cluster
can be keyed with a B-Tree index or a hash table. The data block in which the
table record will be stored is defined by the value of the cluster key.
Column order
 The order in which columns are listed in the index definition is important. It
is possible to retrieve a set of row identifiers using only the first indexed
column. However, it is not possible or efficient (on most databases) to
retrieve the set of row identifiers using only the second or greater indexed
column.
 For example, imagine a phone book that is organized by city first, then by last
name, and then by first name. If you are given the city, you can easily extract
the list of all phone numbers for that city. However, in this phone book it
would be very tedious to find all the phone numbers for a given last name.
You would have to look within each city's section for the entries with that last
name. Some databases can do this, others just won’t use the index.
Types of indexes
 Bitmap index:
A bitmap index is a special kind of index that stores the bulk of its data as bit arrays
(bitmaps) and answers most queries by performing bitwise logical operations on these
bitmaps. The most commonly used index, such as B+trees, are most efficient if the
values it indexes do not repeat or repeat a smaller number of times.
 Dense index:
A dense index in databases is a file with pairs of keys and pointers for every record in
the data file. Every key in this file is associated with a particular pointer to a record
in the sorted data file. In clustered indices with duplicate keys, the dense index
points to the first record with that key.
Types of indexes
 Sparse index:
A sparse index in databases is a file with pairs of keys and pointers for every
block in the data file. Every key in this file is associated with a particular pointer
to the block in the sorted data file. In clustered indices with duplicate keys, the
sparse index points to the lowest search key in each block.
 Reverse index:
A reverse key index reverses the key value before entering it in the index. E.g.,
the value 24538 becomes 83542 in the index. Reversing the key value is
particularly useful for indexing data such as sequence numbers, where new key
values monotonically increase.
Index implementations
 Indices can be implemented using a variety of data structures. Popular indices
include balanced trees, B+ trees and hashes.
 In Microsoft SQL Server, the leaf node of the clustered index corresponds to
the actual data, not simply a pointer to data that resides elsewhere, as is the
case with a non-clustered index. Each relation can have a single clustered
index and many unclustered indices.
Indexing techniques

More Related Content

What's hot

B+ tree
B+ treeB+ tree
Data structure
Data structureData structure
Data structure
snaya
 
spreadsheet program
spreadsheet programspreadsheet program
spreadsheet program
samina khan
 
Types of datastructures
Types of datastructuresTypes of datastructures
Types of datastructures
Madishetty Prathibha
 
Spreadsheet basics ppt
Spreadsheet basics pptSpreadsheet basics ppt
Spreadsheet basics ppt
Tammy Carter
 
Spreadsheet Concepts
Spreadsheet ConceptsSpreadsheet Concepts
Spreadsheet Concepts
Shahzaib Mahesar
 
Spreadsheets and databases
Spreadsheets and databasesSpreadsheets and databases
Spreadsheets and databases
Diana A. Pérez
 
Introduction to spreadsheets
Introduction to spreadsheetsIntroduction to spreadsheets
Introduction to spreadsheets
Tracy Gilmer
 
File Organization in Database
File Organization in DatabaseFile Organization in Database
File Organization in Database
A. S. M. Shafi
 
Applied systems 1 vocabulary
Applied systems 1 vocabularyApplied systems 1 vocabulary
Applied systems 1 vocabularyPaola Rincón
 
B+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionB+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletion
HAMID-50
 
Spreadsheet terminology
Spreadsheet terminologySpreadsheet terminology
Spreadsheet terminology
Tammy Carter
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
Madishetty Prathibha
 
Data storage and indexing
Data storage and indexingData storage and indexing
Data storage and indexing
pradeepa velmurugan
 
Spreadsheets Concepts and Vocab
Spreadsheets Concepts and VocabSpreadsheets Concepts and Vocab
Spreadsheets Concepts and Vocab
Danny Ambrosio
 
Aplied systems- vocabulary
Aplied systems- vocabularyAplied systems- vocabulary
Aplied systems- vocabularySebastian Silva
 
good practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheetsgood practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheetsDescartes Arreza
 
Index in sql server
Index in sql serverIndex in sql server
Index in sql server
Durgaprasad Yadav
 
Creating relationships with tables
Creating relationships with tablesCreating relationships with tables
Creating relationships with tablesJhen Articona
 

What's hot (20)

B+ tree
B+ treeB+ tree
B+ tree
 
Data structure
Data structureData structure
Data structure
 
spreadsheet program
spreadsheet programspreadsheet program
spreadsheet program
 
Types of datastructures
Types of datastructuresTypes of datastructures
Types of datastructures
 
Spreadhsheets 1
Spreadhsheets 1Spreadhsheets 1
Spreadhsheets 1
 
Spreadsheet basics ppt
Spreadsheet basics pptSpreadsheet basics ppt
Spreadsheet basics ppt
 
Spreadsheet Concepts
Spreadsheet ConceptsSpreadsheet Concepts
Spreadsheet Concepts
 
Spreadsheets and databases
Spreadsheets and databasesSpreadsheets and databases
Spreadsheets and databases
 
Introduction to spreadsheets
Introduction to spreadsheetsIntroduction to spreadsheets
Introduction to spreadsheets
 
File Organization in Database
File Organization in DatabaseFile Organization in Database
File Organization in Database
 
Applied systems 1 vocabulary
Applied systems 1 vocabularyApplied systems 1 vocabulary
Applied systems 1 vocabulary
 
B+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionB+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletion
 
Spreadsheet terminology
Spreadsheet terminologySpreadsheet terminology
Spreadsheet terminology
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
Data storage and indexing
Data storage and indexingData storage and indexing
Data storage and indexing
 
Spreadsheets Concepts and Vocab
Spreadsheets Concepts and VocabSpreadsheets Concepts and Vocab
Spreadsheets Concepts and Vocab
 
Aplied systems- vocabulary
Aplied systems- vocabularyAplied systems- vocabulary
Aplied systems- vocabulary
 
good practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheetsgood practices in formatting ms excel spreadsheets
good practices in formatting ms excel spreadsheets
 
Index in sql server
Index in sql serverIndex in sql server
Index in sql server
 
Creating relationships with tables
Creating relationships with tablesCreating relationships with tables
Creating relationships with tables
 

Similar to Indexing techniques

Index Structures.pptx
Index Structures.pptxIndex Structures.pptx
Index Structures.pptx
MBablu1
 
DMBS Indexes.pptx
DMBS Indexes.pptxDMBS Indexes.pptx
DMBS Indexes.pptx
husainsadikarvy
 
Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship
ShouaQureshi
 
Database management system session 6
Database management system session 6Database management system session 6
Database management system session 6
Infinity Tech Solutions
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
Ala Qunaibi
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on lineMilind Patil
 
3620121datastructures.ppt
3620121datastructures.ppt3620121datastructures.ppt
3620121datastructures.ppt
SheejamolMathew
 
lecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptxlecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptx
peter1097
 
dotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesdotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelines
Javier García Magna
 
Data structure & algorithms introduction
Data structure & algorithms introductionData structure & algorithms introduction
Data structure & algorithms introduction
Sugandh Wafai
 
Data Structure the Basic Structure for Programming
Data Structure the Basic Structure for ProgrammingData Structure the Basic Structure for Programming
Data Structure the Basic Structure for Programming
paperpublications3
 
Static arrays are structures whose size is fixed at compile time and.pdf
Static arrays are structures whose size is fixed at compile time and.pdfStatic arrays are structures whose size is fixed at compile time and.pdf
Static arrays are structures whose size is fixed at compile time and.pdf
anjanacottonmills
 
database concepts.pptx
database concepts.pptxdatabase concepts.pptx
database concepts.pptx
slavskrillex
 
Data Structure the Basic Structure for Programming
Data Structure the Basic Structure for ProgrammingData Structure the Basic Structure for Programming
Data Structure the Basic Structure for Programming
paperpublications3
 
153680 sqlinterview
153680  sqlinterview153680  sqlinterview
153680 sqlinterview
zdsgsgdf
 

Similar to Indexing techniques (20)

Index Structures.pptx
Index Structures.pptxIndex Structures.pptx
Index Structures.pptx
 
DMBS Indexes.pptx
DMBS Indexes.pptxDMBS Indexes.pptx
DMBS Indexes.pptx
 
Unit08 dbms
Unit08 dbmsUnit08 dbms
Unit08 dbms
 
Ardbms
ArdbmsArdbms
Ardbms
 
Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship
 
Database management system session 6
Database management system session 6Database management system session 6
Database management system session 6
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on line
 
3620121datastructures.ppt
3620121datastructures.ppt3620121datastructures.ppt
3620121datastructures.ppt
 
lecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptxlecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptx
 
dotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesdotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelines
 
Data structure & algorithms introduction
Data structure & algorithms introductionData structure & algorithms introduction
Data structure & algorithms introduction
 
Data Structure the Basic Structure for Programming
Data Structure the Basic Structure for ProgrammingData Structure the Basic Structure for Programming
Data Structure the Basic Structure for Programming
 
Static arrays are structures whose size is fixed at compile time and.pdf
Static arrays are structures whose size is fixed at compile time and.pdfStatic arrays are structures whose size is fixed at compile time and.pdf
Static arrays are structures whose size is fixed at compile time and.pdf
 
database concepts.pptx
database concepts.pptxdatabase concepts.pptx
database concepts.pptx
 
Data Structure the Basic Structure for Programming
Data Structure the Basic Structure for ProgrammingData Structure the Basic Structure for Programming
Data Structure the Basic Structure for Programming
 
Storage struct
Storage structStorage struct
Storage struct
 
Indexing
IndexingIndexing
Indexing
 
Sql
SqlSql
Sql
 
153680 sqlinterview
153680  sqlinterview153680  sqlinterview
153680 sqlinterview
 

More from Huda Alameen

Architectural design
Architectural designArchitectural design
Architectural design
Huda Alameen
 
System Modeling
System ModelingSystem Modeling
System Modeling
Huda Alameen
 
Requirements Engineering
Requirements EngineeringRequirements Engineering
Requirements Engineering
Huda Alameen
 
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
Huda Alameen
 
Java input Scanner
Java input Scanner Java input Scanner
Java input Scanner
Huda Alameen
 
Java Print method
Java  Print methodJava  Print method
Java Print method
Huda Alameen
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
Huda Alameen
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
Huda Alameen
 
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)
Huda Alameen
 
Sql viwes
Sql viwesSql viwes
Sql viwes
Huda Alameen
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
Huda Alameen
 
Normalization
NormalizationNormalization
Normalization
Huda Alameen
 
Lecture one db
Lecture one dbLecture one db
Lecture one db
Huda Alameen
 
Introduction to structured query language
Introduction to structured query languageIntroduction to structured query language
Introduction to structured query language
Huda Alameen
 
Agg fun
Agg funAgg fun
Agg fun
Huda Alameen
 
Se lec1 (1)
Se lec1 (1)Se lec1 (1)
Se lec1 (1)
Huda Alameen
 
Se lec6
Se lec6Se lec6
Se lec6
Huda Alameen
 
Se lec5
Se lec5Se lec5
Se lec5
Huda Alameen
 
Se lec 4
Se lec 4Se lec 4
Se lec 4
Huda Alameen
 
Se lec 3
Se lec 3Se lec 3
Se lec 3
Huda Alameen
 

More from Huda Alameen (20)

Architectural design
Architectural designArchitectural design
Architectural design
 
System Modeling
System ModelingSystem Modeling
System Modeling
 
Requirements Engineering
Requirements EngineeringRequirements Engineering
Requirements Engineering
 
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
 
Java input Scanner
Java input Scanner Java input Scanner
Java input Scanner
 
Java Print method
Java  Print methodJava  Print method
Java Print method
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
 
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)
 
Sql viwes
Sql viwesSql viwes
Sql viwes
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Normalization
NormalizationNormalization
Normalization
 
Lecture one db
Lecture one dbLecture one db
Lecture one db
 
Introduction to structured query language
Introduction to structured query languageIntroduction to structured query language
Introduction to structured query language
 
Agg fun
Agg funAgg fun
Agg fun
 
Se lec1 (1)
Se lec1 (1)Se lec1 (1)
Se lec1 (1)
 
Se lec6
Se lec6Se lec6
Se lec6
 
Se lec5
Se lec5Se lec5
Se lec5
 
Se lec 4
Se lec 4Se lec 4
Se lec 4
 
Se lec 3
Se lec 3Se lec 3
Se lec 3
 

Recently uploaded

extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
DiyaBiswas10
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
Cherry
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
AADYARAJPANDEY1
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SELF-EXPLANATORY
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
aishnasrivastava
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
muralinath2
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
silvermistyshot
 
Lab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerinLab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerin
ossaicprecious19
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
muralinath2
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
sachin783648
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
Sérgio Sacani
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
Predicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfPredicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdf
binhminhvu04
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
FAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsFAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable Predictions
Michel Dumontier
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 

Recently uploaded (20)

extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
 
Lab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerinLab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerin
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
Predicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfPredicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdf
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
FAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsFAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable Predictions
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 

Indexing techniques

  • 1. Indexing Techniques Assistant Lecturer Huda A. Alameen hudaa.alameen@uokufa.edu.iq
  • 2. Indexing Techniques  A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random lookups and efficient access of ordered records.  In a relational database, an index is a copy of one part of a table. Some databases extend the power of indexing by allowing indices to be created on functions or expressions. For example, an index could be created on upper(last_name), which would only store the upper case versions of the last_name field in the index.
  • 3. Index architecture :Non-clustered  The data is present in arbitrary order, but the logical ordering is specified by the index. The data rows may be spread throughout the table regardless of the value of the indexed column or expression. The non-clustered index tree contains the index keys in sorted order, with the leaf level of the index containing the pointer to the record (page and the row number in the data page in page-organized engines; row offset in file-organized engines).  In a non-clustered index: 1.The physical order of the rows is not the same as the index order. 2.Typically created on non-primary key columns used in JOIN, WHERE, and ORDER BY clauses.  There can be more than one non-clustered index on a database table.
  • 4. Index architecture :Clustered  Clustering alters the data block into a certain distinct order to match the index, resulting in the row data being stored in order. Therefore, only one clustered index can be created on a given database table. Clustered indices can greatly increase overall speed of retrieval, but usually only where the data is accessed sequentially in the same or reverse order of the clustered index, or when a range of items is selected.
  • 5. Cluster  When multiple databases and multiple tables are joined, it's referred to as a cluster (not to be confused with clustered index described above). The records for the tables sharing the value of a cluster key shall be stored together in the same or nearby data blocks. This may improve the joins of these tables on the cluster key, since the matching records are stored together and less I/O is required to locate them.The data layout in the tables which are parts of the cluster is defined by the cluster configuration. A cluster can be keyed with a B-Tree index or a hash table. The data block in which the table record will be stored is defined by the value of the cluster key.
  • 6. Column order  The order in which columns are listed in the index definition is important. It is possible to retrieve a set of row identifiers using only the first indexed column. However, it is not possible or efficient (on most databases) to retrieve the set of row identifiers using only the second or greater indexed column.  For example, imagine a phone book that is organized by city first, then by last name, and then by first name. If you are given the city, you can easily extract the list of all phone numbers for that city. However, in this phone book it would be very tedious to find all the phone numbers for a given last name. You would have to look within each city's section for the entries with that last name. Some databases can do this, others just won’t use the index.
  • 7. Types of indexes  Bitmap index: A bitmap index is a special kind of index that stores the bulk of its data as bit arrays (bitmaps) and answers most queries by performing bitwise logical operations on these bitmaps. The most commonly used index, such as B+trees, are most efficient if the values it indexes do not repeat or repeat a smaller number of times.  Dense index: A dense index in databases is a file with pairs of keys and pointers for every record in the data file. Every key in this file is associated with a particular pointer to a record in the sorted data file. In clustered indices with duplicate keys, the dense index points to the first record with that key.
  • 8. Types of indexes  Sparse index: A sparse index in databases is a file with pairs of keys and pointers for every block in the data file. Every key in this file is associated with a particular pointer to the block in the sorted data file. In clustered indices with duplicate keys, the sparse index points to the lowest search key in each block.  Reverse index: A reverse key index reverses the key value before entering it in the index. E.g., the value 24538 becomes 83542 in the index. Reversing the key value is particularly useful for indexing data such as sequence numbers, where new key values monotonically increase.
  • 9. Index implementations  Indices can be implemented using a variety of data structures. Popular indices include balanced trees, B+ trees and hashes.  In Microsoft SQL Server, the leaf node of the clustered index corresponds to the actual data, not simply a pointer to data that resides elsewhere, as is the case with a non-clustered index. Each relation can have a single clustered index and many unclustered indices.