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.

Table index fundamentals

Table index fundamentals

- Sequel Server depends on indexes in order to locate specific records in a table as quickly as possible. We looked at indexing briefly when we created an index view in an earlier chapter. Let's talk about them in a little more detail and explore how they're created in a data table and how they benefit the database. The first and most straight forward method of finding a record is called a Table Scan. With this method Sequel Server simply starts at the top of the table then reads down until the appropriate data is found or the bottom of the table is reached. A Table Scan is how Sequel Server approaches a table that doesn't include any indexing assistance or what's known as a "heap". A "heap" is simply a table that lacks an index and must be scanned completely in order to find a specific row. If an index is available when a record is requested from the table, either through an ad hoc query or a stored procedure,…

Contents