I'm analyzing a query being run inside our system via sp_executesql. I am able to execute the query on the production database and include the actual execution plan. In the execution plan results window, a simple nonclustered index is suggested.
Based upon the suggestion, I have added the index. However, when I re-run the same query, it continues to suggest the same index. Why would it think that the index does not exist?
Best Answer
The suggested index can differ from your actual index if you miss out INCLUDEd columns or some the direction (ASC/DESC) is different
I've answered similar on SO before