sql primary key and index

后端 未结 11 1408
误落风尘
误落风尘 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:21

    Primary keys are always indexed by default.

    You can define a primary key in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL. Creating a primary key automatically creates a corresponding unique, clustered or nonclustered index.

    http://technet.microsoft.com/en-us/library/ms189039.aspx

提交回复
热议问题