Articles → SQL SERVER → Covering Index In SQL Server

Covering Index In SQL Server






Technical Knowledge




  1. Basics of SQL server
  2. Clustered and non-clustered index
  3. What is the difference between scan and seek?
  4. Basics about execution plans

Non-Clustered Index And Key Loop Ups




Column NameData Type
Idint
Titlevarchar (300)
DeadlineDate
Assigned Tovarchar (100)






Picture showing the logical representation of table having non-clustered index applied on the columns




select Title from Task where Title = 'Task 1'




Picture showing the execution plan of the select query having columns where non-clustered index is applied




select Title, Deadline from Task where Title = 'Task 1'




Picture showing the execution plan of the select query having columns where non-clustered index is not applied



Covering Index






CREATE NONCLUSTERED INDEX non_clustered_index_name ON table_name(column_name) include (list_of_included_columns)




CREATE NONCLUSTERED INDEX ix_Title ON Task(Title) include (Deadline)




Picture showing the select query with the column where covering index is applied



Posted By  -  Karan Gupta
 
Posted On  -  Friday, April 3, 2015

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250