SQLITE_WARNINGWARNINGTier 1 — Safe⚠️ MEDIUM confidenceWarning from sqlite3_log()
Category: LoggingVersions: 3.7.15+
🔴 Production Risk Error
Low — warnings indicate potential performance issues, not failures.
What this means
SQLITE_WARNING (28) is passed to the sqlite3_log() callback for warnings — non-fatal issues that may indicate a misconfiguration or suboptimal usage, such as using an auto-index.
Why it happens
- 1SQLite created an automatic index to satisfy a query (SQLITE_WARNING_AUTOINDEX).
- 2Extension or VFS emitting a non-fatal warning.
How to reproduce
sqlite3_log() callback; not returned by API functions.
trigger — this will ERROR
-- Trigger SQLITE_WARNING_AUTOINDEX:
PRAGMA automatic_index = ON;
CREATE TABLE a(x); CREATE TABLE b(x);
-- Unindexed join forces autoindex:
SELECT * FROM a JOIN b ON a.x = b.x;
-- Log will show: "automatic index on b(x)"Log message: "automatic index on b(x)" with code SQLITE_WARNING_AUTOINDEX (284).
Fix 1
Why this works
Add a manual index on the joined column to suppress the autoindex warning: CREATE INDEX idx_b_x ON b(x);
Version notes
Dangerous variant
⚠️ Warning
SQLITE_WARNING_AUTOINDEX (284) — query using an automatic index; may be slow.
Sources
📚 Official docs: https://www.sqlite.org/rescode.html#warning
🔧 Source ref: sqlite3.h — SQLITE_WARNING = 28
📖 Further reading: Automatic indexes in SQLite
Confidence assessment
⚠️ MEDIUM confidence
Stable.
See also
🔗 Related errors
📄 Reference pages
SQLite automatic indexes
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →