Full table scan
Data & DatabasesReading every row to answer one question.
What the database resorts to when no index supports your query. Instant with ten rows, catastrophic with ten million, which is why this problem never appears during development.
See also Index, Query
Index
Data & DatabasesA lookup structure that makes one kind of query fast.
Like the index at the back of a book. Makes lookups on the indexed column fast, does nothing for other columns, costs storage, and slows down writes. Chosen per query pattern, not sprinkled everywhere.
See also Query, N+1, Full table scan
N+1
Data & DatabasesOne query for the list, then one per item.
Fetching 50 posts and then fetching each post’s author separately: 51 round trips. Invisible with test data, ruinous with real data. A database call inside a loop is the tell.
See also Query, Index
Query
Data & DatabasesA question asked of the database.
A request for data. Cheap when an index supports it, ruinous when it forces a scan of every row. Which questions you ask should be a design decision, not an accident.
See also Index, N+1, Full table scan
SQL
Data & DatabasesThe language for asking relational databases questions.
The query language of relational databases. Also used loosely to mean the relational family itself (Postgres, MySQL, SQLite) as opposed to NoSQL.
See also Query, NoSQL, Table