我使用 SQL Server 2012。
我想知道什么时候我想知道在什么情况下我必须使用CREATE NONCLUSTERED COLUMNSTORE INDEX ....
以及在什么情况下我必须使用Create NonClustered Index... Include
以及在什么情况下我必须使用Create NonClustered Index...
所有列。
相对于其他有什么优势和劣势
例子:
Use [AdventureWorksDW2012]
Go
CREATE NONCLUSTERED COLUMNSTORE INDEX csi_FactResellerSales
ON dbo.FactResellerSales
(ProductKey, UnitPrice, CustomerPONumber, OrderDate);
SELECT ProductKey, UnitPrice, CustomerPONumber, OrderDate
FROM dbo.FactResellerSales;
Drop Index csi_FactResellerSales On [dbo].[FactResellerSales]
Create NonClustered Index Ardalan
On [dbo].[FactResellerSales] (ProductKey) include(UnitPrice, CustomerPONumber,
OrderDate)
SELECT ProductKey, UnitPrice, CustomerPONumber, OrderDate
FROM dbo.FactResellerSales;
Drop Index Ardalan On [dbo].[FactResellerSales]
Create NonClustered Index Ardalan1
On [dbo].[FactResellerSales] (ProductKey,UnitPrice, CustomerPONumber, OrderDate)
SELECT ProductKey, UnitPrice, CustomerPONumber, OrderDate
FROM dbo.FactResellerSales;
Drop Index Ardalan1 On [dbo].[FactResellerSales]