sql primary key and index

后端 未结 11 1427
误落风尘
误落风尘 2020-12-04 11:36

Say I have an ID row (int) in a database set as the primary key. If I query off the ID often do I also need to index it? Or does it being a primary key mean it\'s already in

11条回答
  •  醉酒成梦
    2020-12-04 12:18

    You are right, it's confusing that SQL Server allows you to create duplicate indexes on the same field(s). But the fact that you can create another doesn't indicate that the PK index doesn't also already exist.

    The additional index does no good, but the only harm (very small) is the additional file size and row-creation overhead.

提交回复
热议问题