Sample Header Ad - 728x90

Is there any difference with specifying the primary key as an include column in a nonclustered index?

7 votes
1 answer
711 views
Don't nonclustered indexes inherently store a reference to the primary key on a table so that it can do a key lookup as needed?...if so, is it any less or more performant to specify the primary key as an included column when creating a nonclustered index? Side question, why does the nonclustered index default to storing the primary key and not the clustered index fields to do a key lookup on the table?...In the cases where the primary key is not the clustered index, isn't it slower for the key lookup to occur whereas if it stored the clustered index it could do the lookup that way?
Asked by J.D. (40893 rep)
Feb 1, 2020, 10:41 PM
Last activity: Feb 2, 2020, 10:59 AM