From the course: Developing Microsoft SQL Server 2016 Databases

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Non-clustered indexes

Non-clustered indexes

- [Narrator] Non-clustered indexes exist as separate objects from a table, but just like the clustered index they must be maintained every time a new record is inserted, removed, or altered. They work in parallel with the table to provide a secondary sorting based off their own key column or columns. Let's suppose that we're looking through this table for a customer with a last name that starts with the letter L. One option is to start at the top and scan down through every record until we find the one that we want. That could work relatively well in a small table, but then again it might be a processor intensive process if the table has any bulk to it. Further, if the last name field doesn't have a unique constraint applied to it, we can't simply stop as soon as we find the first instance of the name that we're looking for, since there could possibly be more. Instead we'll want to have created an index on the last…

Contents