Index fragmentation is, perhaps, one of those rare topics that does not entirely belong to the “It Depends” category. Most database professionals agree that fragmentation negatively affects the system. While that is correct, it is still important to understand the downside of index fragmentation and analyze how your system is affected by it.
In this chapter, we will talk about internal and external index fragmentation in SQL Server, what code and design patterns increase fragmentation, and what factors must be taken into account when designing an index maintenance strategy.