From the course: Microsoft SQL Server 2019 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Data table indexes

Data table indexes - SQL Server Tutorial

From the course: Microsoft SQL Server 2019 Essential Training

Start my 1-month free trial

Data table indexes

- [Instructor] SQL Server depends on indexes in order to locate specific records in a table as quickly as possible. Without an index, SQL Server needs to perform something called a table scan when trying to locate specific records. With this method, SQL Server simply starts at the top of the table and reads down until the appropriate data is found, or the bottom of the table is reached. A table scan is how SQL 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 to find a specific row. If an index is available, though, all of the records within the table are kept in a predictable, sorted order. When a record is requested from an index table, a table seek is performed on something called the B-tree, or a balanced tree structure. In a B-tree structured index, the root level branches out into one or more intermediate levels, and then finally ends at the leaf level…

Contents