From the course: SQL Server 2014 Essential Training

Unlock the full course today

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

Basics of indexes

Basics of indexes - SQL Server Tutorial

From the course: SQL Server 2014 Essential Training

Start my 1-month free trial

Basics of indexes

- In this section, we're gonna talk about indexes. An index and a database maintains a copy of a subset of table data, so an index is typically linked to one table and the index will contain some of the data in that table, but not all of it. Indexes are ordered by one of the columns and these two properties combined the fact that it is a subset of data, a smaller amount of data, and the fact that it is ordered, makes it faster to search. Obviously, searching a small data structure is faster than searching a large data structure and also, when something is ordered, we can search it more quickly. If we're searching for a particular value that starts with the letter A, the machine knows that it only has to search the first part of the index, where those items would come up if it is ordered by that column. The downside of indexes is they must be updated. Typically, every time a table is updated, all of it's indexes must be updated also and therefore, updating data or inserting new data…

Contents