Filtered index is a feature added in SQL Server 2008 and serves a great purpose for some of the requirements
As a general we all know that index improves search performance if INDEX is created properly
But some cases where we font requires data from entire column but only some filtered values
Even for this we have to create index for data entire column.
Whenever we query this column it has to read index for all values column.
But if we want only certain value from column based on some logic then is there any other option available?
In this case it would be better if we create index only filtered value of column so it will put less overhead on the
server in terms of maintenance as well as server will have to check less amount of data while reading from index
Lets create first normal index than we will create filtered index and check this.
We want to check for orderqty > 10 for all out requirements.
Lets see space used by this 2 indexes
We can see that space used by filtered index much lesser compare to non filtered index
Ok , how to find index is filtered ?
For unique index
One more use of filtered index is for creating unique index by filtering not unique values
Let see an example
Now I want to create unique index on data column but it has multiple null values
We will use filtered index here to filter null values
