Hi Friends,

Today, I just want to explain about a new type of Index, which introduce in SQL Server 2008 (SQL Server Filtered Indexes).

What is Filtered Index?

Filtered Index is a special type of nonclustered index, which is having a filter criteria. Filtered Index can improve query performance and plan quality. Filtered index can also Reduce index maintenance cost as well as index storage cost.

Now the question arises that when we should use Filtered Indexes?Now we can understand this with a very good example. suppose, i have a table xtInfo in the database GEEKS and this table contain three columns id, name, citywhere city may contain Null values.

here xtinfo table contain total 9999 rows. where city column contains NOT NULL values for 2894 rows. I know here that i will use this table to select only those rows for which city column contain values.Now i want to create indexes on this table as shown below:

Now I want to run the query:

now the statistics output of this query is shown below:


now i am creating a new index, which is filtered index:

now, i again run the query

now the statistics output of this query is shown below:


With the help of above statistics, it is clear that filtered index provide improvement in performance. Here for only demo purpose i take less ammount of data in my table but if you have large amount of such type data then filtered index  provide you the great improvement.



Prince Rastogi

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook