3

Is it possible to filter results of sp_BlitzIndex to show only unused and duplicate indexes? If so, how?

I haven't tried anything yet. Was just giving a thought of inserting sp output in a table and then filter it there. But I am sure there must be a better way.

I know this should go to Brent and team. But posting it here to get some more interesting answers.

Paul White
  • 94,921
  • 30
  • 437
  • 687
SQLPRODDBA
  • 1,928
  • 2
  • 33
  • 48

1 Answers1

10

We recently added more options to the sp_BlitzIndex output, but the kind of housecleaning mode you're asking about isn't one of them, unfortunately.

The closest it gets to that is to run it with @Mode = 4 (as of v3.0) or @Mode = 0 (prior to v3.0), which I suspect you're already doing. The benefit to using the v3.0 is you can use the @GetAllDatabases = 1 parameter to collect all the unused/dupes for the whole SQL Server instance in one pass.

I suggest storing the output to a table and querying it for only the unused/dupes. Probably not the answer you were hoping for, but sp_BlitzIndex doesn't have that functionality built in.

Kin Shah
  • 62,545
  • 6
  • 124
  • 245
Doug Lane
  • 658
  • 7
  • 15