Zalgorithm

Database indexes at a high level

At a high level, a database index is an auxiliary data structure that helps an SQL database find rows without scanning an entire table. Think of how a book’s index lets you find the page numbers relevant to some topic by looking up the topic alphabetically.

An SQL index maps column values to database rows. For example, if a users table had a last_name index, the index might tell you that users with the last name "Smith" existed on rows 3, 7, and 9 of the database.