I have an iOS app, with a table that has 1500 records.
I'm using FMDB, invoking the following form:
FMDatabase *db = ...
[db executeQuery:@"select num from a where b = ?", 6];
The table "a" has an index on "b".
This runs fine in the simulator, but on an iPad1 is taking a very long time. It consumes memory until the app is killed. Instruments says its stuck in "sqlite3_prepare_v2".
The original query also had an "order by" clause. I've removed it to test. I can even completely remove the where clause and it still behaves this way.
Any ideas what might be wrong?
Other queries are working before this occurs. I have previously accessed the database from a different thread, but there is no access from any other thread going on. I had thought I might have a dangling transaction, but that isn't the case either.