7 votes
Accepted

Unique index on computed column when contributing columns are already unique

It's a trade-off only you can really decide on. You'll already have a Split-Sort-Collapse operator combination added to any plans that update Discount or CodeNumber to avoid false transient unique key ...
Paul White's user avatar
  • 83.7k
1 vote

Effect on execution plans when a table variable has a primary key

revival I forget what I was doing in 2017 when this was originally asked, but I figured I'd throw a couple examples in of when indexing a table variable may provide some benefit. There are many ...
Erik Darling's user avatar
  • 40.5k

Only top scored, non community-wiki answers of a minimum length are eligible