SQLITE_WARNING_AUTOINDEXWARNINGTier 1 — Safe⚠️ MEDIUM confidenceQuery using automatic index (log warning)
🔴 Production Risk Error
Low — performance warning; queries still return correct results but may be slow.
What this means
SQLITE_WARNING_AUTOINDEX (284) is passed to the sqlite3_log() callback when the query planner creates an automatic index to satisfy a join or WHERE clause. It is a performance warning, not an error.
Why it happens
- 1JOIN or WHERE clause on a column with no index.
- 2Subquery result used as a join source without an index.
How to reproduce
Query execution when the planner decides to create a transient automatic index.
-- Trigger automatic index:
CREATE TABLE a(x); CREATE TABLE b(x);
INSERT INTO a VALUES(1),(2),(3);
INSERT INTO b VALUES(2),(3),(4);
-- No index on b.x:
SELECT * FROM a JOIN b ON a.x = b.x;
-- Log: "automatic index on b(x)"Fix 1
Why this works
Add an index on the join or filter column: CREATE INDEX idx_b_x ON b(x);
Fix 2
Why this works
Use EXPLAIN QUERY PLAN to identify all automatic indexes in the query.
Sources
📚 Official docs: https://www.sqlite.org/rescode.html#warning_autoindex
🔧 Source ref: sqlite3.h — SQLITE_WARNING_AUTOINDEX = 284
📖 Further reading: Automatic indexes
Confidence assessment
⚠️ MEDIUM confidence
Stable.
See also
🔗 Related errors
📄 Reference pages