# Indexes and Unique Values

An index lets the database find rows by a column without reading the whole table, the way a book's index finds a page, a UNIQUE index makes it refuse a second row with the same email, and the sqlite3.IntegrityError it raises becomes an exception of your own that the rest of the app can understand.

![Cheat sheet: Indexes and Unique Values](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/134d1e8f0f9646989d4135858fdaf974.webp)

- Category: FastAPI
- Level: Journeyman
- Tags: database, EXPLAIN QUERY PLAN, Index (database), Query Plan, sql, sqlite, sqlite3.IntegrityError, Table Scan, Unique Index
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-sql-indexes-and-unique-cheat-sheet
