UNIQUE argument for INDEX creation - what's for?

后端 未结 4 1042
暖寄归人
暖寄归人 2021-01-23 04:11

Why does INDEX creation statement have UNIQUE argument?

As I understand, the non-clustered index contains a bookmark, a pointer to a row, which should be unique to dist

4条回答
  •  温柔的废话
    2021-01-23 04:52

    The UNIQUE clause specifies that the values in the column(s) must be unique across the table, essentially adding a unique constraint. A clustered index on a table specifies that the ordering of the rows in the table will be the same as the index. A non-clustered index does not change the physical ordering, which is why it is OK to have multiple non-clustered but only one clustered index. You can have unique or non-unique clustered and non-clustered indexes on a table.

提交回复
热议问题