CREATE COLUMNSTORE INDEX
defines an index; CREATE/ALTER REBUILD sorts and writes all rows of the key
What changes
- Input
- table or view columns (key, included, filter predicate)
- Output or change
- index structure (B-tree, columnstore, XML, spatial, JSON, vector, full-text)
Syntax at a glance
CREATE CLUSTERED COLUMNSTORE INDEX index_name ON { database_name.schema_name.table_name | schema_name.table_name | table_name } [ ORDER (column [ , ...n ] ) ] [ WITH ( <with_option> [ , ...n ] ) ] [ ON <on_option> ] [ ; ]
Work example
A large analytic table needs compressed scans over a small set of columns.
Compare the scan and load pattern with rowstore access, update rate, and memory needs in a representative lab.
Check your work The index covers the analytic columns and improves the measured scan without blocking required writes.
Open Microsoft Learn for full syntax, permissions, and details for your version.