Koskamo

Indexes and EXPLAIN QUERY PLAN

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

EXPLAIN QUERY PLAN returns a high-level description of the strategy SQLite uses to implement a specific SQL query — most significantly, how the query uses database indexes. For each table read, the detail column begins with SCAN or SEARCH: SCAN means a full-table scan, including iterating all records in an order defined by an index, while SEARCH means only a subset of the table rows is visited. Each SCAN or SEARCH record also reports whether an index or automatic index is used, whether the covering index optimization applies, and which WHERE-clause terms are used for indexing; further output covers temporary sorting B-trees, subqueries, and compound queries. Treat the output as interactive debugging only: the format may change between releases and changed substantially in 3.24.0 and again in 3.36.0, so applications must not depend on it. Run EXPLAIN QUERY PLAN on every slow query and investigate any SCAN on a large table where a SEARCH was expected (Koskamo editorial guidance). Scope: SQLite. Reviewed October 4, 2026.

Source and provenance

Original source
sqlite.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.