Sql server 创建列存储索引

Sql server 创建列存储索引,sql-server,database-indexes,columnstore,Sql Server,Database Indexes,Columnstore,是否可以在sql中已经有聚集索引和非聚集索引的表上创建列存储索引是的,这是可能的。例如: CREATE TABLE SimpleTable (ProductKey [int] NOT NULL, OrderDateKey [int] NOT NULL, DueDateKey [int] NOT NULL, ShipDateKey [int] NOT NULL); GO CREATE CLUSTERED INDEX cl_simple ON SimpleTable (ProductKey);

是否可以在sql中已经有聚集索引和非聚集索引的表上创建列存储索引

是的,这是可能的。例如:

CREATE TABLE SimpleTable
(ProductKey [int] NOT NULL, 
OrderDateKey [int] NOT NULL, 
DueDateKey [int] NOT NULL, 
ShipDateKey [int] NOT NULL);
GO
CREATE CLUSTERED INDEX cl_simple ON SimpleTable (ProductKey);
GO

CREATE NONCLUSTERED INDEX noncl_simple ON SimpleTable(OrderDateKey);
GO

CREATE NONCLUSTERED COLUMNSTORE INDEX csindx_simple
ON SimpleTable
(OrderDateKey, DueDateKey, ShipDateKey);
GO

你好,尼古拉,谢谢你回答我的问题。我成功地在现有表上创建了一个非聚集列存储索引,该表已经有一个基于行的聚集索引&非聚集索引。如果我需要创建聚集的columnstore索引,而不是首先删除现有的基于行的聚集索引,您能给我一些建议吗???