Reputation: 30121
Are there any differences between these two covered indexes?
Separate MS SQL Server related point. If the answer to the above question is 'No difference', is it me or does the Database Engine Tuning Advisor (DTA) always go crazy on included columns?
Upvotes: 1
Views: 852
Reputation: 294317
Yes, they are different.
The difference implies that indexes on (A,B) are wider that indexes on (A) include (B) so they contain more non-leaf pages, generating a bigger index (more pages), more IO and hence less efficient.
However, an index (A,B) will always cover an index (A) include (B). So if you already have indexes on (A,B) and the Tunning Advisor recommends a new index on (A) include (B), somehting is fishy. Either with the DTA recommendation, either with your analysis of existing indexes. No offense, but on situations like this I tend to trust the DTA over the human analysis, so ensure that your indeed have indexes that already cover the DTA recommendation, including order and filters (for SQL 2008).
Upvotes: 9