• Toreador (5/7/2010)


    vignesh 38804 (5/7/2010)


    Index on identity column improves performance

    If you never use the identity column in queries but only use it as a primary key then doesn't it actually make performance slightly worse?

    If you define the identity column as a PRIMARY KEY, then there always is an index. SQL Server automaticallly creates an index when you create a PRIMARY KEY constraint, and uses that index to enforce the constraint.

    And if you never use the identity column in queries, then the best way to improve performance is to drop that unused column.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/