T-SQL for finding Redundant Indexes

前端 未结 5 711
Happy的楠姐
Happy的楠姐 2020-12-03 12:51

Is anyone aware of a T-SQL script that can detect redundant indexes across an entire database? An example of a redundant index in a table would be as follows:



        
5条回答
  •  醉梦人生
    2020-12-03 13:22

    I was just reading some MSDN blogs, noticed a script to do this and remembered this question.

    I haven't bothered testing it side by side with Andomar's to see if one has any particular benefit over the other.

    One amendment I would likely make to both though would be to take into account the size of both indexes when assessing redundancy.

    Edit:

    Also see Kimberley Tripp's post on Removing duplicate indexes

提交回复
热议问题