olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

Measure fragmentation based on Internal Index Fragmentation #671

Open lukaszherman opened 2 years ago

lukaszherman commented 2 years ago

Measure fragmentation based on Internal Index Fragmentation as Erik Darling suggest https://www.erikdarlingdata.com/because-your-index-maintenance-script-is-measuring-the-wrong-thing/

Added new startup parameter @MeasureInternalFragmentation to turn on this behaviour. Quering indexes to change is more time consuming because of quering avg_page_space_used_in_percent with 'SAMPLED' instead of 'LIMITED'.