Inspect scans, searches, and covering-index use.

Section: Planner tools

Explain query plan

sql
sql
EXPLAIN QUERY PLAN
SELECT id, created_at
FROM notes
WHERE user_id = 42
ORDER BY created_at DESC
LIMIT 20;
Explanation

SQLite reports whether it scans a table, searches with an index, or can use a covering index optimization.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Planner tools
Analyze statistics
Populate or refresh planner statistics.
OpenIn sheetsqlsame section
Use the .expert shell helper
Ask the SQLite shell for index advice.
OpenIn sheetbashsame section
Create an index
Add a basic lookup index.
OpenIn sheetsql1 tag match
Expression index
Index a computed expression used in the query.
OpenIn sheetsql1 tag match
Partial index
Index only matching rows.
OpenIn sheetsql1 tag match