sql-servernon-clustered-index

Execution plan gives hint for different Indexes every time


SQL Server keeps on changing option to build Non clustered Index on a table.

1st time, SQL Server gave warning to build a index on 18 columns to improve performance by 55%.

I build those indexes and then the SQL ran for 16 minute At the end of execution, it gave new warning to build index differently on the same table to improve performance by 70%.

However, when I run the SQL after implementing new Indexes, it runs for over 30 minutes.

Is there any recommendation on what attributes should be included for Non clustered right after table name and Include option


Solution

  • What you are seeing in the query plan is the Missing Indexes feature. This feature is notoriously bad at identifying useful performance improvements. I have learned to ignore it unless the calculated improvement is over around 95%. Even then, the suggestions are usually already covered adequately by other indexes.

    I would suggest you remove all of the indexes you just created. After that, please post the plan at https://www.brentozar.com/pastetheplan, link it here in a new question. It may be more apparent from the plan what the real problem is.