#title Filtered Indexes and Statistics [[TableOfContents]] ==== Filtered Index ==== 필터링된 인덱스는 필터 조건자를 사용하여 테이블의 일부 행을 인덱싱한다. 다음과 같은 장점이 있다. * 향성된 쿼리 성능 및 계회 품질 * 줄어든 인덱스 유지 관리 비용 * 줄어든 인덱스 저장소 비용 ==== Example ==== {{{ use tempdb go --drop table test create table test(gender nchar(1)); with temp(num) as ( select 1 num union all select num + 1 from temp where num + 1 <= 10 ) insert test(gender) select N'남' -- 1000건 from temp a, temp b, temp c union all select N'여' -- 10건 from temp; create nonclustered index filtered_nix on test(gender) where gender = N'여'; --full scan 유리 select * from test where gender = N'남' --실제로 Full Scan함. --index seek 유리 select * from test where gender = N'여' --실제로 Index Seek함. }}} ==== 참고자료 ==== * [http://www.mssqltips.com/tip.asp?tip=1785 SQL Server Filtered Indexes - What They Are, How to Use and Performance Advantages] * [http://www.databasejournal.com/features/mssql/article.php/3811161/Exploring-SQL-Server-2008s-Filtered-Indexes.htm Exploring SQL Server 2008’s Filtered Indexes] * [http://technet.microsoft.com/en-us/library/cc280372.aspx Filtered Index Design Guidelines]