SlideShare a Scribd company logo
1 of 23
INDEXING Davood Pour Yousefian Barfeh
INDEXING ,[object Object],[object Object],[object Object],[object Object]
What is index? ,[object Object],[object Object],[object Object]
Why is Index needed? (((((Advantage))))) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Indexing (((((Disadvantage))))) ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Ex. Without Indexing
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Ex.Using Indexing
When  should  indexing be used?   can ,[object Object],[object Object],[object Object],[object Object]
When should indexing be used? ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],When should indexing be used?
When should indexing be used? ,[object Object],[object Object],[object Object],[object Object],[object Object],Index Selectivity = Number of distinct values Number of records
When should indexing be used? ,[object Object],[object Object],SELECT newstitle, firstname, lastname  FROM newsitem n, authors a  WHERE n.authorid=a.authorid; CREATE INDEX newsitem_authorid  ON newsitem(authorid); General Rule: Any fields involved in a table join must be indexed  CREATE TABLE newsitem (   newsid INT PRIMARY KEY,   newstitle VARCHAR(255),   newscontent TEXT,   authorid INT,   newsdate TIMESTAMP ); CREATE TABLE authors (   authorid INT PRIMARY KEY,   username VARCHAR(255),   firstname VARCHAR(255),   lastname VARCHAR(255) );
When should indexing be used? SELECT n.newstitle, c.categoryname  FROM categories c, newsitem_categories nc, newsitem n  WHERE c.categoryid=nc.categoryid AND nc.newsid=n.newsid; These fields must be indexed: newsitem   newsid newsitem_categories   newsid newsitem_categories   categoryid categories   categoryid CREATE INDEX newscat_news  ON newsitem_categories(newsid); CREATE INDEX newscat_cats  ON newsitem_categories(categoryid); Ex. CREATE TABLE newsitem (   newsid INT PRIMARY KEY,   newstitle VARCHAR(255),   newscontent TEXT,   authorid INT,   newsdate TIMESTAMP ); CREATE TABLE newsitem_categories (   newsid INT,   categoryid INT ); CREATE TABLE categories (   categoryid INT PRIMARY KEY,    categoryname VARCHAR(255) );
Combination on Indexing CREATE INDEX newscat_news ON newsitem_categories(newsid); CREATE INDEX newscat_cats ON newsitem_categories(categoryid); CREATE INDEX news_cats ON newsitem_categories(newsid, categoryid); Can we do? YES but LIMITATIONs
Conjunctions in Cobnations on Indexing CREATE TABLE example (   a int,   b int,   c int ); CREATE INDEX example_index  ON example(a,b,c);   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Types of indexes (1) ,[object Object],[object Object],indexes whose order of the rows in the data page correspond to the order of the rows in the index  ,[object Object],[object Object],[object Object],[object Object],[object Object],Order of rows is not important
Types of indexes (2) ,[object Object],[object Object],help maintain data integrity by ensuring  that no two rows of data in a table  have identical key values uniqueness is enforced   improve query performance  by maintaining a sorted order of data values  that are used frequently
Types of indexes (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Types of indexes (4) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Syntax of Index (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Access Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Syntax of Index(2) ,[object Object],[object Object],[object Object],[object Object]
Summary  ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

5013 Indexing Presentation
5013 Indexing Presentation5013 Indexing Presentation
5013 Indexing Presentationlmartin8
 
Indexing languages (2)
Indexing languages (2)Indexing languages (2)
Indexing languages (2)yhen06
 
WEB BASED INFORMATION RETRIEVAL SYSTEM
WEB BASED INFORMATION RETRIEVAL SYSTEMWEB BASED INFORMATION RETRIEVAL SYSTEM
WEB BASED INFORMATION RETRIEVAL SYSTEMSai Kumar Ale
 
An Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in librariesAn Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in librariesAaron Tay
 
Database indexing techniques
Database indexing techniquesDatabase indexing techniques
Database indexing techniquesahmadmughal0312
 
Abstract and i ndexing
Abstract and i ndexingAbstract and i ndexing
Abstract and i ndexingMohit Kumar
 
Probabilistic retrieval model
Probabilistic retrieval modelProbabilistic retrieval model
Probabilistic retrieval modelbaradhimarch81
 
key word indexing and their types with example
key word indexing and their types with example key word indexing and their types with example
key word indexing and their types with example Sourav Sarkar
 
Information retrieval system!
Information retrieval system!Information retrieval system!
Information retrieval system!Jane Garay
 
Information Processing: Cataloguing
Information Processing: Cataloguing Information Processing: Cataloguing
Information Processing: Cataloguing Sundar B N
 
Reference Sources: Origin, Evaluation and Use
Reference Sources: Origin, Evaluation and UseReference Sources: Origin, Evaluation and Use
Reference Sources: Origin, Evaluation and UsePrince Raja
 
Spiral of Scientific method
Spiral of Scientific methodSpiral of Scientific method
Spiral of Scientific methodMonalishaNayak31
 
UNIVERSAL DECIMAL CLASSIFICATION-UDC
UNIVERSAL DECIMAL CLASSIFICATION-UDCUNIVERSAL DECIMAL CLASSIFICATION-UDC
UNIVERSAL DECIMAL CLASSIFICATION-UDCDr. Anjaiah Mothukuri
 
Inernet use and application in library
Inernet use and application in libraryInernet use and application in library
Inernet use and application in libraryS.M. Ashif
 
Information Retrieval Models
Information Retrieval ModelsInformation Retrieval Models
Information Retrieval ModelsNisha Arankandath
 
Co operative cataloguing
Co operative cataloguingCo operative cataloguing
Co operative cataloguingshashimgl
 

What's hot (20)

5013 Indexing Presentation
5013 Indexing Presentation5013 Indexing Presentation
5013 Indexing Presentation
 
Indexing languages (2)
Indexing languages (2)Indexing languages (2)
Indexing languages (2)
 
WEB BASED INFORMATION RETRIEVAL SYSTEM
WEB BASED INFORMATION RETRIEVAL SYSTEMWEB BASED INFORMATION RETRIEVAL SYSTEM
WEB BASED INFORMATION RETRIEVAL SYSTEM
 
An Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in librariesAn Introduction To The Use Of Widgets in libraries
An Introduction To The Use Of Widgets in libraries
 
Database indexing techniques
Database indexing techniquesDatabase indexing techniques
Database indexing techniques
 
Abstract and i ndexing
Abstract and i ndexingAbstract and i ndexing
Abstract and i ndexing
 
Probabilistic retrieval model
Probabilistic retrieval modelProbabilistic retrieval model
Probabilistic retrieval model
 
key word indexing and their types with example
key word indexing and their types with example key word indexing and their types with example
key word indexing and their types with example
 
Information retrieval system!
Information retrieval system!Information retrieval system!
Information retrieval system!
 
Abstracts & abstracting
Abstracts & abstractingAbstracts & abstracting
Abstracts & abstracting
 
Information Processing: Cataloguing
Information Processing: Cataloguing Information Processing: Cataloguing
Information Processing: Cataloguing
 
Reference Sources: Origin, Evaluation and Use
Reference Sources: Origin, Evaluation and UseReference Sources: Origin, Evaluation and Use
Reference Sources: Origin, Evaluation and Use
 
Spiral of Scientific method
Spiral of Scientific methodSpiral of Scientific method
Spiral of Scientific method
 
Precis
PrecisPrecis
Precis
 
UNIVERSAL DECIMAL CLASSIFICATION-UDC
UNIVERSAL DECIMAL CLASSIFICATION-UDCUNIVERSAL DECIMAL CLASSIFICATION-UDC
UNIVERSAL DECIMAL CLASSIFICATION-UDC
 
Inernet use and application in library
Inernet use and application in libraryInernet use and application in library
Inernet use and application in library
 
Information Retrieval Models
Information Retrieval ModelsInformation Retrieval Models
Information Retrieval Models
 
CANONS OF CATALOGUING ppt
CANONS OF CATALOGUING pptCANONS OF CATALOGUING ppt
CANONS OF CATALOGUING ppt
 
Co operative cataloguing
Co operative cataloguingCo operative cataloguing
Co operative cataloguing
 
Unisist ppt
Unisist pptUnisist ppt
Unisist ppt
 

Similar to Indexing

Indexing techniques
Indexing techniquesIndexing techniques
Indexing techniquesHuda Alameen
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 Andriy Krayniy
 
Indexing Strategies
Indexing StrategiesIndexing Strategies
Indexing Strategiesjlaspada
 
Physical elements of data
Physical elements of dataPhysical elements of data
Physical elements of dataDimara Hakim
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql queryvuhaininh88
 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL IndexingBADR
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7Syed Asrarali
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6Ala Qunaibi
 
Cs437 lecture 16-18
Cs437 lecture 16-18Cs437 lecture 16-18
Cs437 lecture 16-18Aneeb_Khawar
 
Database Performance
Database PerformanceDatabase Performance
Database PerformanceBoris Hristov
 

Similar to Indexing (20)

Indexing
IndexingIndexing
Indexing
 
Indexing techniques
Indexing techniquesIndexing techniques
Indexing techniques
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Unit08 dbms
Unit08 dbmsUnit08 dbms
Unit08 dbms
 
Cs341
Cs341Cs341
Cs341
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
 
MySQL Indexes
MySQL IndexesMySQL Indexes
MySQL Indexes
 
Indexing Strategies
Indexing StrategiesIndexing Strategies
Indexing Strategies
 
Physical elements of data
Physical elements of dataPhysical elements of data
Physical elements of data
 
Database Sizing
Database SizingDatabase Sizing
Database Sizing
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql query
 
Mysql Optimization
Mysql OptimizationMysql Optimization
Mysql Optimization
 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL Indexing
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7
 
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
 
Module 3
Module 3Module 3
Module 3
 
Cs437 lecture 16-18
Cs437 lecture 16-18Cs437 lecture 16-18
Cs437 lecture 16-18
 
Database Performance
Database PerformanceDatabase Performance
Database Performance
 

Recently uploaded

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

Indexing

  • 1. INDEXING Davood Pour Yousefian Barfeh
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. When should indexing be used? SELECT n.newstitle, c.categoryname FROM categories c, newsitem_categories nc, newsitem n WHERE c.categoryid=nc.categoryid AND nc.newsid=n.newsid; These fields must be indexed: newsitem  newsid newsitem_categories  newsid newsitem_categories  categoryid categories  categoryid CREATE INDEX newscat_news ON newsitem_categories(newsid); CREATE INDEX newscat_cats ON newsitem_categories(categoryid); Ex. CREATE TABLE newsitem (   newsid INT PRIMARY KEY,   newstitle VARCHAR(255),   newscontent TEXT,   authorid INT,   newsdate TIMESTAMP ); CREATE TABLE newsitem_categories (   newsid INT,   categoryid INT ); CREATE TABLE categories (   categoryid INT PRIMARY KEY,   categoryname VARCHAR(255) );
  • 14. Combination on Indexing CREATE INDEX newscat_news ON newsitem_categories(newsid); CREATE INDEX newscat_cats ON newsitem_categories(categoryid); CREATE INDEX news_cats ON newsitem_categories(newsid, categoryid); Can we do? YES but LIMITATIONs
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.