SQLite Database gives warning automatic index on (column) After upgrading Android L

Automatic indexing was introduced in sqlite 3.7.17. A version of sqlite with this feature was only included in Android L developer preview. This is why you get the message only on Lollipop but not earlier. Even if it is logged as an error, it’s really just a message.

Basically, the automatic indexing comes into play when you’re doing lookups on non-indexed columns. sqlite assumes there’s so much data that generating a temporary index is cheaper than raw lookup.

Consider adding explicit, permanent indices for your lookup columns with CREATE INDEX. For example, after your CREATE TABLE:

CREATE INDEX indexname ON tablename(columnname);

where you can pick tablename(columnname) from the autoindex messages as produced by sqlite.

If you just want the old behavior back, you can disable auto-indexing with

PRAGMA automatic_index=off;

Leave a Comment