Difference in UNique Non-Clustered and Non-Clustered

  • Hi Experts,

    Is there any difference in unique Non-Clustered and Non-Clustered and non-clustered index. What is the effect of adding a non-clustered index to a unique column and creating a unique non-clustered index on the same column.

  • A nonclustered index that is defined as unique (CREATE UNIQUE NONCLUSTERED INDEX ...) enforces uniqueness on its key columns. A nonclustered index defined without the unique keyword doesn't.

    Not that much more to it than that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks Gail..

    I think the space used by non-unique non-clustered index is on higher side when compare to unique non-clustered index 111 vs 107.

  • The optimizer will know that an index is unique and may use that as part of it's decision process when putting together the execution plan.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply