This chapter covers
- Index fragmentation
- Index maintenance
- How indexes interact with extract, transform, load processes
- Database Engine Tuning Advisor
- Columnstore indexes
In this chapter, we will first explore some common mistakes and misconceptions around fragmentation. Understanding index fragmentation can be crucial to a well-performing database. For example, index fragmentation is often considered universally bad, but we will explore how too little internal fragmentation can lead to bad page splits.
We will then turn our attention to index maintenance and look at various mistakes that can lead to an increase in index fragmentation and suboptimal performance. These mistakes range from not rebuilding indexes at all to rebuilding them indiscriminately. We will also assess how index maintenance interacts with updating statistics.
We will explore how indexes impact extract, transform, load (ETL) operations. Specifically, we will explore bulk load operations and discuss how our index strategies are crucial to a performant ETL run. After this, we will take a look at Database Tuning Advisor and think about why it might not be a good idea to rely too heavily on this feature.
Finally, we will look at columnstore indexes, which can add incredible performance improvements to analytical and data warehouse–style workloads. Despite being introduced to SQL Server over a decade ago, they're still not used by many people. We will discuss why this is and why it is a mistake.