On weekly basis I rebuild all indexes of a database. Due the continuously grow of the database size the duration of the rebuild operations exceeds the available maintenance window of 5 hours.
Therefore I want to use a script for rebuilding or reorganize indexes based on the avg_fragmentation_in_percent. Let’s say I will use the standard values for reorganize if fragmentation is between 5% and 30%. And perform a rebuild if the fragmentation exceeds 30%. However I’m wondering if that’s the right approach for large indexes.
In example I have a clustered index with 4915490 pages. The avg_fragmentation_in_percent is just 0,01. However the fragment_count is 141074. I’m wondering how bad will be the fragmentation before it reaches the threshold of 5% for a reorganize will be performed for this index.
Does anyone know if reorganize or rebuilding indexes based on avg_fragmentation_in_percent value is valid for large indexes?