Thoughts on index creation for SQL Server for missing indexes

后端 未结 1 561
小蘑菇
小蘑菇 2020-12-28 19:50

I\'m working on performance tuning my SQL Server 2008 database and am using the output from various DMVs to identify missing indexes, indexes that aren\'t being used, etc.

1条回答
  •  时光说笑
    2020-12-28 20:22

    Order matters for indexed columns, but not included columns. This is because only key columns are used for lookups.

    You have to "read between the lines" of most of the documentation, but that's what they're implying in this BOL article

    This discussion is a bit more explicit in saying order isn't important.

    Pretty much the only concern with included columns in indexes is space--the indexes can get quite large if you include lots of columns, or very large columns. BUT this means you definitely don't want to do two separate indexes, each with the same key columns but different included ones. Then you're just compounding your space problem.

    0 讨论(0)
提交回复
热议问题