Columnstore Index
Introduced in SQL Server 2012 (nonclustered), and enhanced with clustered support in 2014, Columnstore indexes are particularly well-suited for data warehouses and reporting systems. Instead of storing entire rows, the index stores each column separately, allowing the engine to access only the relevant columns during query execution.
Key benefits:
- High compression rates due to similar data types within columns.
- Reduced I/O from scanning only necessary columns.
- Batch mode execution, which processes rows in blocks, greatly improving CPU efficiency.
There are two main types:
- Clustered Columnstore Index (CCI): compresses the entire table; ideal for fact tables in a star schema.
- Nonclustered Columnstore Index (NCCI): can be added to OLTP tables, especially useful for hybrid workloads.
Starting with SQL Server 2016, columnstore indexes support updatable clustered configurations and filtered indexes, increasing flexibility. By using them, DBAs can significantly reduce storage requirements and improve reporting query speeds.