sqlite3 app.db 'EXPLAIN QUERY PLAN SELECT * FROM users WHERE email="a@b.com";'

Category: Databases & SQL

sqlite3 app.db 'EXPLAIN QUERY PLAN SELECT * FROM users WHERE email="a@b.com";'

Show how SQLite executes a query

Prints whether the query scans the whole table or uses an index — the essential first step when tuning slow queries. Related: CREATE INDEX.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.