table scan
Reading every row of a table to find the ones that match, instead of jumping to them through an index.
In more detail
In a SQLite plan it appears as SCAN; PostgreSQL calls it a sequential scan. A scan is fine for small tables or conditions that match most rows, and a warning sign on a large table with a selective condition.
Related terms
- index — A separate, sorted structure a database keeps alongside a table so it can find matching rows without reading them all.
- query plan — The step-by-step route the database has chosen to answer a query: which tables to read, in what order, and with which indexes.
- index search — In a query plan, a step that starts from a key in an index and reads only the matching rows.
Taught in
- Indexes And What They Cost — PostgreSQL, Indexing & Relational Data Modeling
- Reading An EXPLAIN Plan — PostgreSQL, Indexing & Relational Data Modeling