SQLite Indexes and Query Planner Cheatsheet/Enable automatic EXPLAIN QUERY PLAN in shell

Show plans before each entered statement.

Section: Inspect query plans

Enable automatic EXPLAIN QUERY PLAN in shell

text
text
.eqp on
Explanation

Handy during interactive tuning sessions in the sqlite3 shell.

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 Inspect query plans
Explain a query plan
See whether SQLite scans or uses an index.
OpenIn sheetsqlsame section
Collect statistics with ANALYZE
Help the planner choose better indexes.
OpenIn sheetsqlsame section
Rebuild indexes
Recreate indexes when needed.
OpenIn sheetsqlsame section
Run PRAGMA optimize
Let SQLite perform lightweight maintenance.
OpenIn sheetsqlsame section
Create a basic index
Index a frequently filtered column.
Create a composite index
Index multiple columns in query order.