SQL Server – Does Column Order Matter in Columnstore Index?

columnstoredatabase-designindexsql serversql-server-2012

I have a table with ~200 million rows and ~15 columns in it. I am planning to create a COLUMNSTORE index on my table.

Will there be any change in performance based on the order of columns that I use in the columnstore index? If yes, what is the logic behind it?

Best Answer

No, order does not matter. Each column is considered individually.

From the SQL Server team (emphasis added):

Typically you will want to put all the columns in your table into the columnstore index. It does not matter what order you list the columns because a columnstore index does not have a key like a B-tree index does. Internally, the data will be re-ordered automatically to get the best compression.