What is index fragmentation, and how does it affect performance?
Last updated
Index fragmentation builds up from inserts, updates, and deletes. External fragmentation means the logical page order no longer matches physical order. Internal fragmentation means pages are only partly full.
It hurts range scans with more page reads, random I/O, and wasted buffer cache. Point seeks suffer far less, and SSDs reduce the random-I/O penalty.
Fix with
REORGANIZEfor moderate fragmentation orREBUILDfor heavy fragmentation. An appropriate fill factor reduces future page splits.
- https://learn.microsoft.com/en-us/sql/relational-databases/indexes/reorganize-and-rebuild-indexes?view=sql-server-ver17
- https://dev.to/mariemoalla/sql-server-index-fragmentation-what-it-is-and-how-to-fix-1f9f
- https://mariemoalla.medium.com/sql-server-index-fragmentation-what-it-is-and-how-to-fix-6066c65c711e
- https://www.solarwinds.com/resources/it-glossary/index-fragmentation
- https://www.idera.com/blogs/sql-server-index-fragmentation-guide/
- https://medium.com/@rongalinaidu/sql-server-fixing-index-fragmentation-and-stale-statistics-ccaf99c7bab1
- https://www.devart.com/blog/sql-server-index-fragmentation-in-depth.html
- https://www.sqlshack.com/how-to-identify-and-resolve-sql-server-index-fragmentation/