Index Key Column VS Index Included Column

前端 未结 5 711
迷失自我
迷失自我 2021-01-30 12:42

Can someone explain this two - Index Key Column VS Index Included Column?

Currently, I have an index that has 4 Index Key Column and 0 Included Column.

Thanks

5条回答
  •  时光取名叫无心
    2021-01-30 12:50

    Included columns don't form part of the key for the index, but they do exist on the index. Essentially the values will be duplicated, so there is a storage overhead, but there is a greater chance that your index will cover (i.e. be selected by the query optimizer for) more queries. This duplication also improves performance when querying, since the database engine can return the value without having to look at the table itself.

    Only nonclustered indexes can have included columns, because in a clustered index, every column is effectively included.

提交回复
热议问题