From the course: SQL Server 2016: Administer a Database Infrastructure
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Identify and repair index fragmentation - SQL Server Tutorial
From the course: SQL Server 2016: Administer a Database Infrastructure
Identify and repair index fragmentation
- [Instructor] Index fragmentation has a negative impact on query performance, and occurs when records are removed from data tables and the order of the values in the index no longer corresponds to the order that they appear in the logical data file. Defragmenting the index through a process of either re-organizing or rebuilding can return things to a proper order. Let's go ahead and explore this I'm going to switch into the wide world importers database. And I'm going to create a new data table called DBO dot new people. And we're just going to copy out to the person ID full name, phone number, email address, is employee columns from the applications dot people table. Next, we're going to alter the table DBO dot people and we're going to add in a new constraint which is a primary key which I'll call PK underscore person ID. We'll apply that to the person ID column. Next, I'll just select everything out of the data table so we can see all 1,111 records that were copied out. Now I'm…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.