????????

??????2008????????????????????????????1???——??????????filter index??????????????where????????????????????????????????????????????????????????????洢?????????????

?????????????

??????AdventureWorks2012????????Production.WorkOrder??????????????????????

???????裺

????1???????????????????Production.WorkOrder?У?

CREATE INDEX idx_WorkOrder_ScrapReasonID ON Production.WorkOrder(ScrapReasonID)

GO

????2????????????????????????????????????

DBCC SHOW_STATISTICS('Production.WorkOrder'??IX_WorkOrder_ScrapReasonID)

GO

????3????????£?

????4????All denisty?У?????????????????????????????????????

DROP INDEX IX_WorkOrder_ScrapReasonID ON Production.WorkOrderGO CREATE INDEX IX_WorkOrder_ScrapReasonID ON Production.WorkOrder(ScrapReasonID)WHERE ScrapReasonID IS NOT NULL GO

????5???????в???All density?У???????????????

 DBCC SHOW_STATISTICS('Production.WorkOrder'??IX_WorkOrder_ScrapReasonID)

GO

 

DROP INDEX IX_WorkOrder_ScrapReasonID ON Production.WorkOrder

GO

????6????????£?

??????????

?????????????????ж???????????????????????????row sampled????????????????72591?????????729?????????100??????Filter Expression?У??????null??????????

??????All density?У?????????????ScriptReasonID?У?????????????????????????б??????????ScriptReasonID?????????????????????С?