在現有表上新增聚簇列儲存索引
CREATE CLUSTERED COLUMNSTORE INDEX 使你能夠以列格式組織表:
DROP TABLE IF EXISTS Product
GO
CREATE TABLE Product (
Name nvarchar(50) NOT NULL,
Color nvarchar(15),
Size nvarchar(5) NULL,
Price money NOT NULL,
Quantity int
)
GO
CREATE CLUSTERED COLUMNSTORE INDEX cci ON Product