2009年11月2日 星期一

SQL Server 2008 -- Filtered Indexes

1.Filtered indexes provide a way to create more targeted indexes that require less storage and can support more efficient queries.
2.Filtered indexes are particularly well suited for indexing non-NULL values of sparse columns.
--**********Filtered Indexes**********
--Creating and Testing a Filtered Index
--on the Production.Product Table
CREATE NONCLUSTERED INDEX IX_Product_Size
ON Production.Product(Size, SizeUnitMeasureCode)
WHERE Size IS NOT NULL;
GO

SELECT ProductID, Size, SizeUnitMeasureCode
FROM Production.Product WHERE Size = 'L';
GO

沒有留言:

張貼留言