Sql-server – How to add an “INCLUDE” part in an Index Created as a part of CONSTRAINT

indexoptimizationsql servert-sql

I am going through the execution plan of a tsql query.

enter image description here

There is a key LookUp (Clustered) in the plan. To avoid this Key LookUp, I tried to Include a column (Status_Ind) to The Index (The Index used in execution plan). But I realize that optimizer is using two Indexes, One the Primary Key index and the 2nd one, an index automatically created as a part of a Constraint (A UNIQUE NONCLUSTERED Index). I find no way to add an include part in this Index.

How do we add an INCLUDE in an index which is automatically created (through CONSTRAINTS)? I am really a beginner in Query optimization.

Best Answer

It is not possible to have an INCLUDE column for an index that enforces a constraint. This has been brought up, but marked as "won't fix".

If the benefits of having a covering index are that great, consider revising the indexing strategy that you currently have on that table to maximize query performance.