Index fragmentation in MSSQL Server

MSSQL server index fragmentation check code snippet I had in my archive. It shows what indices would be good to add, and also shows the most CPU intense queries. A nice SQL optimization toolkit.

Following previous SQL optimization and tips&tricks post, posting a few more SQL optimization code snippets.

https://gist.github.com/ignas-sakalauskas/9baa0667369089b0c5cdba29723be833