question

yatitandon avatar image
yatitandon asked

Sql Server keeps on changing warning to build Non clustered Index on a table.

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 minutes and 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?

nonclustered-index
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·

SQL Server will suggest indexes based on current query patterns. It's not uncommon to see similar missing indexes within the DMV. This is and should be a moving target that has to be re-addressed periodically. Usually a good rule of thumb is that the key columns should be the predicates and join criteria and any includes the columns returned (as a starting point).

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.