From the course: SQL Server Performance for Developers

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Filtered indexes

Filtered indexes - SQL Server Tutorial

From the course: SQL Server Performance for Developers

Start my 1-month free trial

Filtered indexes

- [Instructor] Let's talk about filtered indexes. This is a feature that was introduced in SQL Server 2008. It's something I don't see commonly. It doesn't always have a ton of use cases, but there are some specific use cases where you want to be able to take advantage of this feature. You may ask, "What do we mean by creating a filtered index versus just a normal index?" A filtered index is simply a non-clustered index with a where clause, just like you would put in a select statement. When doing this where clause, you're excluding a group of records from your index. This means a couple of things. It gives you a smaller overall index on disk, it gives you increased selectivity, so the queries that can use that filtered index are going to return faster and perform less logical reads because the index is going to have more specific information. Where do you really want to use filtered indexes? When you have a high degree of data skew, so if you have a large number of distinct values…

Contents