SQLite Index

Summary: in this tutorial, you will learn how to use SQLite indexes to query data faster, speed up sort operations, and enforce unique constraints.

What is an index?

In relational databases, a table is a list of rows. At the same time, each row has the same column structure that consists of cells. Each row also has a consecutive rowid sequence number used to identify the row. Therefore, you can consider a table as a list of pairs: (rowid, row).

Unlike a table, an index has an opposite relationship: (row, rowid). An index is an additional data structure that helps improve the performance of a query.