Database Reference
In-Depth Information
When the wizard starts, we will notice that there is no key column. it's also worth
noting that all columns are included columns. It is also worth noting that the
clustered columnstore index does not work with other indexes. If another index
exits, you won't be able to create a clustered columnstore index, and if you have
a clustered columnstore index, you won't be able to create another index type.
Much like a normal clustered index which sorts and stores the data rows of table,
a clustered columnstore index will store the data for the entire table. Clustered
columnstore indexes are an enterprise-only feature in SQL Server 2014.
The transact-SQL statement for creating a clustered columnstore index is as follows:
CREATE CLUSTERED COLUMNSTORE INDEX
[ClusteredColumnStoreIndex-20140301-113651]
ON [dbo].[t2] WITH (DROP_EXISTING = OFF) ON [PRIMARY]
GO
You can issue a CREATE CLUSTERED INDEX statement that specifies the name of the
columnstore index and then specify a name, the table to create it on, and specify a
filegroup to create it on.
Updating a table with a clustered columnstore
index
In the following example, a table named t2 has been created with two columns, aptly
named C1 and C2. The code for creating the table is as follows:
CREATE TABLE [dbo].[t2](
[c1] [int] NOT NULL,
[c2] [varchar](50) NULL
) ON [PRIMARY]
GO
The code needed to create a columnstore index for the previous table is as follows:
CREATE CLUSTERED COLUMNSTORE INDEX
[ClusteredColumnStoreIndex-20140301-113651]
ON [dbo].[t2] WITH (DROP_EXISTING = OFF) ON [PRIMARY]
GO
 
Search WWH ::




Custom Search