columnstore index - add all columns?

  • When creating a column store index, are there any reasons not to include all columns, besides index size of course?

    i.e. will the index be more versatile with more columns or should I treat it exactly like its a standard index, putting only necessary columns, in the correct order?

  • Because of the way the columnstore index works, the order of the columns is not important.

    Typically you would try to include all possible columns, at least all the ones which are referenced by SELECT queries.

    The problem is that once you have created the index, you cannot simply add columns; you'd have to drop the index and create it again with the additional column.

    Data is greatly compressed, so index size is less affected by additional columns than a regular index.

    There are restrictions on some data types, so in practice it might not be possible to include all of the columns.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply