• Rechana Rajan - Tuesday, January 10, 2017 3:16 AM

    I have observed that for a query when the PK is in select list and if we create a NC index with column in where clause and add PK as include column this improves performance from NC index seek and keyloopup to new non clustered index seek . My doubt is when we create a Non clustered index the clustering key is already a part of it and then why adding PK column as included help change the execution plan to a better performance. Please correct me if I am wrong.

    Your wording suggests that you assume that PK is always a clustered index.
    It's not necessarily the case.
    A table with PK may have another index as clustered, or not have a clustered index at all.

    _____________
    Code for TallyGenerator