Clustered columnstore indexes
In the last section of this chapter, you will learn how to manage a clustered columnstore index (CCI). Besides optimizing query performance, you will also learn how to add a regular B-tree nonclustered index (NCI) to a CCI and use it instead of the primary key or unique constraints. When creating the NCCI in the previous section, the LZ77 or the archive compression has not been used yet. You will use it with a CCI in this section. Altogether, you will learn how to do the following:
- Create clustered columnstore indexes
- Use archive compression
- Add B-tree NCI to a CCI
- Use B-tree NCI for a constraint
- Update data in a CCI
Compression and query performance
Let's start by dropping both indexes from the demo fact table, the NCCI and the CI, to make a heap again:
USE WideWorldImportersDW; -- Drop the NCCI DROP INDEX NCCI_FactTest ON dbo.FactTest; -- Drop the CI DROP INDEX CL_FactTest_DateKey ON dbo.FactTest; GO
Now let's create the clustered columnstore...