March 19, 2014 at 2:37 am
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.
March 19, 2014 at 2:39 am
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
March 19, 2014 at 3:25 am
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.
March 19, 2014 at 4:06 am
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