Hello learners. This article describes covering indexes and filtered indexes. I would like to tell you that these types of indexes can only be created as NON-CLUSTERED.
Before I proceed, I would like to tell you the difference between Key Columns and Non-Key Columns. Many of us know about this huge difference, but some of us may not. So, in order to have a better understanding, please keep this in mind. I will explain the difference using a simple example of creating indexes.
Create NonClustered Index Ix_NC_Test
On Test(Col1)
Include(Col2, Col3)
Here, Col1 is the Key Column, the column that is used while creating Indexes; the other Columns in the included clauses are Non-Key columns in the case of Non-Clustered Indexes. You can also learn this as the Primary Columns (Key Columns) and Secondary Columns (Columns in Include Clause).
CREATE CLUSTERED INDEX Ix_C_Test ON Test(Col1, Col2, Col3)
Here, columns 1, 2, and 3 all are Key Columns. Suppose the table has Col4 and 5 as well, they will be called Non-Key Columns. Let us see another example.
Create Clustered Index Ix_C_Test
On Test(Col1)
Here, Col 1 is the Key Column, and Col 2, 3, 4, and 5 are Non-Key Columns.
So, let’s understand what Covering Indexes are, how they help in query optimization, and how they can be created. We all know Indexes help us to fetch data more quickly but only when carefully created. As it is just not a cakewalk, there are many things to consider before creating indexes, like which columns should be included (those columns which are generally used as a predicate or in condition), whether to create a Clustered or Non-Clustered Index, which columns to include as Key Columns and which not.
But generally, indexes are created with a few columns as the more indexes, the more size it will take. When we create indexes on a table and run the query, the SQL Engine scans or seeks the table using the Indexes created on the table. If, in case, certain columns that need to be fetched are not included in the Indexes, then the SQL Engine needs to perform a Key Lookup which actually fetches the associated records after scanning or seeking the Index which in turn add one more operation.
What if I say that you can create an Index using all the required columns you generally use in the predicates; or fetching columns? This will greatly enhance the performance as the SQL Server does not need to perform Key LookUp for the Non-Key Values which it does when it does not find such columns in Key Columns. So, let’s understand the Covered Indexes with some examples.

Inserting Test_CI with some random records.










Rohit KainthPosted Feb 19, 2021, 7:39 AM
Thanks for the support Learners! Few words of appreciation is what boosts to go further. Thanks a lot.
Nagendra BabuPosted Dec 22, 2020, 5:58 AM
Very good article..so simple and more effective..
Kapil Singh KumawatPosted Nov 4, 2018, 6:00 AM
Good article