What are the differences between a clustered and a non-clustered index?

后端 未结 12 1367
攒了一身酷
攒了一身酷 2020-11-29 14:24

What are the differences between a clustered and a non-clustered index?

12条回答
  •  醉梦人生
    2020-11-29 14:52

    Clustered Index

    1. There can be only one clustered index for a table.
    2. Usually made on the primary key.
    3. The leaf nodes of a clustered index contain the data pages.

    Non-Clustered Index

    1. There can be only 249 non-clustered indexes for a table(till sql version 2005 later versions support upto 999 non-clustered indexes).
    2. Usually made on the any key.
    3. The leaf node of a nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

提交回复
热议问题