My question surrounds the missing index DMVs.
If you take any good missing index DMV - Bart Duncan's for example http://blogs.msdn.com/bartd/archive/2007/07/19/are-you-using-sql-s-missing-index-dmvs.aspx
and run it against any DB, one thing that puzzles me is that the PK of the table is frequently in the "include columns" list.
Why is this? The PK is already there, why does it suggest it be "included" as well.
Thanks for the insight.
Largely it's because the optimizer isn't thinking things through the way you would. It sees that it would like to have that column and adds it to the INCLUDE list. This is why almost every time you see someone show just how slick and cool the missing index information is, they usually add all kinds of caveats about testing, verification, double-checking, etc.
answered Oct 13 '09 at 11:11 PM
Grant Fritchey ♦♦