SlideShare a Scribd company logo
8.1 : Indexes SQL Server 2005
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Contents
Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is Index ,[object Object],[object Object],[object Object]
Need of Indexes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Types of indexes ,[object Object],[object Object],[object Object],[object Object]
Types of Index (Continued) ,[object Object],[object Object],[object Object],[object Object],[object Object]
To Work with Index ,[object Object],[object Object],[object Object],CREATE [UNIQUE] [CLUSTERED/NONCLUSTERED]INDEX index_name ON table_name (column_name [, column_name]…)
To Drop Index ,[object Object],[object Object],[object Object],DROP INDEX 'table.index | view.index' [ ,...n ]
Example 1 - Index ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example 2  Index ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Key Points ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Key Points  (Continued) ,[object Object],[object Object],[object Object]
Activity Time (30 minutes) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activity Time (30 minutes) continued ,[object Object],[object Object],[object Object]
Questions & Comments

More Related Content

What's hot

Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
Gurpreet singh
 
Oracle SQL Part 3
Oracle SQL Part 3Oracle SQL Part 3
Oracle SQL Part 3
Gurpreet singh
 
4) databases
4) databases4) databases
4) databasestechbed
 
Technical stream presentation
Technical stream presentationTechnical stream presentation
Technical stream presentation
Dynistics
 
Oracle SQL - Select Part -1 let's write some queries!
Oracle SQL - Select Part -1  let's write some queries!Oracle SQL - Select Part -1  let's write some queries!
Oracle SQL - Select Part -1 let's write some queries!
A Data Guru
 
SQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidSQLite Database Tutorial In Android
SQLite Database Tutorial In Android
Android 5
 
Excel 2007 Unit F
Excel 2007 Unit FExcel 2007 Unit F
Excel 2007 Unit F
Raja Waseem Akhtar
 
Oracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and moreOracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and more
A Data Guru
 
Data Handning with Sqlite for Android
Data Handning with Sqlite for AndroidData Handning with Sqlite for Android
Data Handning with Sqlite for AndroidJakir Hossain
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Amanda Lam
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scene
quest2900
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
sweetysweety8
 
Excel 2007 Unit N
Excel 2007 Unit NExcel 2007 Unit N
Excel 2007 Unit N
Raja Waseem Akhtar
 
MySQL index optimization techniques
MySQL index optimization techniquesMySQL index optimization techniques
MySQL index optimization techniques
kumar gaurav
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
IBM SPSS Statistics Interface - Navigation
IBM SPSS Statistics Interface - NavigationIBM SPSS Statistics Interface - Navigation
IBM SPSS Statistics Interface - Navigation
Thiyagu K
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
Ahsan Kabir
 

What's hot (18)

Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
 
Oracle SQL Part 3
Oracle SQL Part 3Oracle SQL Part 3
Oracle SQL Part 3
 
4) databases
4) databases4) databases
4) databases
 
Technical stream presentation
Technical stream presentationTechnical stream presentation
Technical stream presentation
 
Oracle SQL - Select Part -1 let's write some queries!
Oracle SQL - Select Part -1  let's write some queries!Oracle SQL - Select Part -1  let's write some queries!
Oracle SQL - Select Part -1 let's write some queries!
 
SQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidSQLite Database Tutorial In Android
SQLite Database Tutorial In Android
 
Excel 2007 Unit F
Excel 2007 Unit FExcel 2007 Unit F
Excel 2007 Unit F
 
Oracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and moreOracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and more
 
Data Handning with Sqlite for Android
Data Handning with Sqlite for AndroidData Handning with Sqlite for Android
Data Handning with Sqlite for Android
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scene
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Views
ViewsViews
Views
 
Excel 2007 Unit N
Excel 2007 Unit NExcel 2007 Unit N
Excel 2007 Unit N
 
MySQL index optimization techniques
MySQL index optimization techniquesMySQL index optimization techniques
MySQL index optimization techniques
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
IBM SPSS Statistics Interface - Navigation
IBM SPSS Statistics Interface - NavigationIBM SPSS Statistics Interface - Navigation
IBM SPSS Statistics Interface - Navigation
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 

Viewers also liked

A Descoberta dos habitats
A Descoberta dos habitatsA Descoberta dos habitats
A Descoberta dos habitats
Joana Sousa
 
Java8
Java8Java8
S4 tarea4 garom
S4 tarea4 garomS4 tarea4 garom
S4 tarea4 garom
marcnam
 
Whitepaper
WhitepaperWhitepaper
Whitepaper
docuwriter
 
Уникальный "коренной" метод от Lifelong Income
Уникальный "коренной" метод от Lifelong IncomeУникальный "коренной" метод от Lifelong Income
Уникальный "коренной" метод от Lifelong Incomelifelongincome
 
Final presentation for teachers in action marissa holiber
Final presentation for teachers in action marissa holiberFinal presentation for teachers in action marissa holiber
Final presentation for teachers in action marissa holiberMarissa
 
Testes Unitários
Testes UnitáriosTestes Unitários
Testes Unitários
Jadson Santos
 
S5 tarea5 garom
S5 tarea5 garomS5 tarea5 garom
S5 tarea5 garom
marcnam
 

Viewers also liked (12)

Texturappt
TexturapptTexturappt
Texturappt
 
A Descoberta dos habitats
A Descoberta dos habitatsA Descoberta dos habitats
A Descoberta dos habitats
 
Java8
Java8Java8
Java8
 
S4 tarea4 garom
S4 tarea4 garomS4 tarea4 garom
S4 tarea4 garom
 
Whitepaper
WhitepaperWhitepaper
Whitepaper
 
Уникальный "коренной" метод от Lifelong Income
Уникальный "коренной" метод от Lifelong IncomeУникальный "коренной" метод от Lifelong Income
Уникальный "коренной" метод от Lifelong Income
 
Root
RootRoot
Root
 
Final presentation for teachers in action marissa holiber
Final presentation for teachers in action marissa holiberFinal presentation for teachers in action marissa holiber
Final presentation for teachers in action marissa holiber
 
Rld v3
Rld v3Rld v3
Rld v3
 
Texturas-ppt
Texturas-pptTexturas-ppt
Texturas-ppt
 
Testes Unitários
Testes UnitáriosTestes Unitários
Testes Unitários
 
S5 tarea5 garom
S5 tarea5 garomS5 tarea5 garom
S5 tarea5 garom
 

Similar to Module08

Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
Ala Qunaibi
 
dotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesdotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelines
Javier García Magna
 
Query parameterization
Query parameterizationQuery parameterization
Query parameterization
Riteshkiit
 
Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008
wharrislv
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
DraguClaudiu
 
02 database oprimization - improving sql performance - ent-db
02  database oprimization - improving sql performance - ent-db02  database oprimization - improving sql performance - ent-db
02 database oprimization - improving sql performance - ent-db
uncleRhyme
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Aaron Shilo
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
rainynovember12
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Michael Rys
 
Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexespaulguerin
 
153680 sqlinterview
153680  sqlinterview153680  sqlinterview
153680 sqlinterview
zdsgsgdf
 
Sql Interview Questions
Sql Interview QuestionsSql Interview Questions
Sql Interview Questionsarjundwh
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
Er. Nawaraj Bhandari
 
Database index
Database indexDatabase index
Database index
Riteshkiit
 
Database testing
Database testingDatabase testing
Database testing
Pesara Swamy
 

Similar to Module08 (20)

Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
 
dotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesdotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelines
 
Query parameterization
Query parameterizationQuery parameterization
Query parameterization
 
Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
 
02 database oprimization - improving sql performance - ent-db
02  database oprimization - improving sql performance - ent-db02  database oprimization - improving sql performance - ent-db
02 database oprimization - improving sql performance - ent-db
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
 
Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexes
 
Sql
SqlSql
Sql
 
153680 sqlinterview
153680  sqlinterview153680  sqlinterview
153680 sqlinterview
 
Sql Interview Questions
Sql Interview QuestionsSql Interview Questions
Sql Interview Questions
 
Sql
SqlSql
Sql
 
Sql
SqlSql
Sql
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Module02
Module02Module02
Module02
 
Database index
Database indexDatabase index
Database index
 
Database testing
Database testingDatabase testing
Database testing
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 

Module08

Editor's Notes

  1. Faculty Notes : For example : Indexes in SQL server are like an index that are given at back of any book which helps in finding topics you are looking for.
  2. Faculty Notes: Maintaining indexes requires time and resources. User should not create an index that would not be used frequently. The clustered index should be created before non clustered index. Clustered index changes the order of rows. The non clustered index would need to be rebuilt if it is built before clustered index. Typically, non clustered indexes are created on foreign keys
  3. Faculty Notes: How clustered indexes work SQL server 2005 performs the following steps when it uses a clustered index to search for a value: 1. SQL server 2005 obtains the address of the root page from sysindexes table. 2. The search values are compared with the keys of the root page 3. The highest key value is found on the page where the key value is less than or equal to the search value 4. The page pointer is followed to the next lowest level in the index 5. Steps 3 and 4 are repeated until the data page is reached 6. The rows of data are searched on the data page until the search value is found. If search value is not found on the data page ,no rows are returned by the query.
  4. Faculty notes: SQL server creates non clustered index by default .The data is present in random order but the logical ordering is specified by the index. The data rows may be randomly spread throught the table The non clustered index tree contains the index keys in the sorted order, with the leaf level of the index containing the pointer to the data page and the row no in the data page. SQL server 2005 performs the following steps when it uses a non clustered index to search for value: 1.SQL server obtains the address of the root page from the sysindexes table. 2. The search values are compared with the keys of the root page 3. The Page with the highest key value less than or equal to the search value is found 4. The page pointer is followed to the next lowest level in the index 5. Steps 3 and 4 are repeated until the data page is reached 6.The rows are searched on the leaf page for the specified value .If a match is not found; the table contains no matching rows. 7.If a match is found, the pointer is followed to the data page and row-id in the table, and the requested row is retrieved Non Clustered Index : The data is stored in one place, the index in another, with pointers to the storage location of the data. The items in the index are stored in the order of the index key values, but the information in the table is stored in a different order (which can be dictated by a clustered index). If no clustered index is created on the table, the rows are not guaranteed to be in any particular order.
  5. Faculty notes: UNIQUE creates an index in which each row should contain a different index value. CLUSTERED specifies a clustered index in which the data is sorted on the index attribute. NON CLUSTERED specifies a non clustered index that specifies only the logical Ordering of data, physically data is not sorted. Index_name specifies name of the index .it should be unique for a table, but may not be unique within a database. Table_name specifies name of the table that contains the attributes on which the index is to be created. Columns specifies name of the columns on which the index would be created.
  6. Faculty Notes Examples This example removes the index named au_id_ind in the authors table. USE pubs IF EXISTS (SELECT name FROM sysindexes WHERE name = 'au_id_ind') DROP INDEX authors.au_id_ind GO
  7. Faculty Notes : This Examples shows that user can create the index using create command Create index pk1_index on employees (EmployeeID) pk1_index is the Index name Employees is the table name present in Northwind database To view the index whether index is created or not use the following statements sp_help employees. Sp_helpindex employees To drop the index use the following command drop index employees.pk1_index