What is the difference between Unique Key and Index with IsUnique=Yes?

后端 未结 6 1464
别那么骄傲
别那么骄傲 2021-02-04 23:45

I have a table with a primary key, but I want two other columns to be constrained so the combination of the two is guaranteed always to be unique.

(a dumb example: In a

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 00:07

    I do not think there is any difference between them but using unique index , we can have two benefits , as the column is already unique and also had the index on it so i gonna be more faster to search . So using unique index is more benefit.

提交回复
热议问题