【发布时间】:2023-04-01 11:20:01
【问题描述】:
是否可以在 sql 中已经有聚集索引和非聚集索引的表上创建列存储索引
【问题讨论】:
标签: sql-server database-indexes columnstore
是否可以在 sql 中已经有聚集索引和非聚集索引的表上创建列存储索引
【问题讨论】:
标签: sql-server database-indexes columnstore
是的,这是可能的。示例:
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
【讨论】: