2

I am running the below select query, it was working 100% before iOS 8.2. This query was returned perfect result set in iOS 8.1 and older. The App is stucked on sqlite3_step, it taks forever to complete. Any one with a idea why? My App is stuck on the users devices. Below is the query and the code.

NSString *sqlStatement = @"Select W.woorde, R.woorde, W.woordIDs, R.woordIDs from masterWoorde W, masterWoorde R, masterWaardes WD, masterWoorde Rr where Rr.woorde LIKE ? And Rr.woordIDs=WD.skoonLeidraadID and WD.leidraadID=W.woordIDs and WD.resultaatID=R.woordIDs ORDER BY W.woorde COLLATE NOCASE, R.woorde COLLATE NOCASE";

if (prepareStatus == SQLITE_OK) {
            sqlite3_bind_text(select_statement, 1, [dboObject.frases UTF8String], -1, SQLITE_STATIC);

            while (sqlite3_step(select_statement) == SQLITE_ROW) {

                productSModel * aProduct = [[productSModel alloc] init];
                aProduct.frases = [NSString stringWithUTF8String:(char *)sqlite3_column_text(select_statement, 0)];
                aProduct.ABC = [NSString stringWithUTF8String:(char *)sqlite3_column_text(select_statement, 1)];
                aProduct.CDE = sqlite3_column_int(select_statement, 2);
                aProduct.FGH = sqlite3_column_int(select_statement, 3);

                [arrResult addObject:aProduct];
            }
        }
Anton Kovalenko
  • 20,999
  • 2
  • 37
  • 69
user722905
  • 21
  • 1
  • 1
  • `sqlite3_step()` is what actually executes the query. Show the output of [EXPLAIN QUERY PLAN](http://www.sqlite.org/eqp.html) for this query with the SQLite versions of iOS 8.1 and 8.2. – CL. Apr 06 '15 at 07:34

1 Answers1

1

This issue has been traced to changes in SQLite between iOS 8.1 and iOS 8.2. See Sqlite3 query gets really slow under iOS 8.2

Community
  • 1
  • 1
kevinlawler
  • 930
  • 1
  • 9
  • 19