How would you decide whether to use a clustered columnstore index or a traditional partitioned rowstore table for a very large historical sales table?
Short answer
You would consider the primary use case, choosing a clustered columnstore index if the table is mainly used for large analytical aggregations and reporting where compression and scan speed matter most, or a partitioned rowstore approach if the table also needs frequent…
Advertisement
AModel answer
You would consider the primary use case, choosing a clustered columnstore index if the table is mainly used for large analytical aggregations and reporting where compression and scan speed matter most, or a partitioned rowstore approach if the table also needs frequent, efficient single row operations or very specific partition level maintenance operations like sliding window archiving.
-- Combining both: a partitioned clustered columnstore index
CREATE CLUSTERED COLUMNSTORE INDEX CCI_Sales
ON SalesFact
ON PartitionScheme(SaleDate);Real-world example
A large retailer combines partitioning with a clustered columnstore index on their historical sales table, gaining both the fast analytical query performance of columnstore and the maintenance benefits of being able to quickly archive or remove old partitions.
Likely follow-ups
- Can columnstore indexes and table partitioning be used together effectively?
- What maintenance operations become easier when a large table is partitioned?
Related topics