From the course: Microsoft SQL Server 2019 Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Rebuild indexes

Rebuild indexes

- Every time data is altered in a table, the indexes need to be updated as well. Adding new records, means new entries in the index need to be created. Modifying and deleting records, causes similar changes in the index. All of these rewrites and changes over time, can cause the index to become fragmented. This means that the way that the index is stored on your hard drive, becomes split up and shuffled around, into an order that is different than the way that SQL Server needs to access it. To get some details on the status of your indexes, you can turn to a couple of reports that Management Studio provides. We're going to right click on the Landon Hotel Database, and then come down to the reports option. Then I'll point to standard reports, and we'll see a long list of different reports that we can run. Two of them relate to indexes, Index Usage Statistics and Index Physical Statistics. Let's take a look at the…

Contents