Post

Replies

Boosts

Views

Activity

SQlite FTS Queries Running Slow iOS 17.2.1 >=
As the title says, our app has begun running into a strange issue every time a user upgrades their iPhone to the latest iOS versions. It started in 17.2.1 and looks like it made a resurgence in 17.3. Post update the user's FullText Searches against the local sqlite db run egregiously slow. Fully re-installing the app and re-downloading all content seems to correct the issue, after which their searches come back in less than 500 ms tops. When the bug occurs searches can take upwards of 15 secs in some cases to complete... What makes no sense is why all of a sudden this is happening in 17.2.1 >= Our app uses an old school approach (historic code we never removed) to create a local sqlite database from scratch on first app install in the user's device contentDir. this .db file is instantiated on each app load using the following: private func sqliteOpenDB(url: URL) -> OpaquePointer? { var db: OpaquePointer? if sqlite3_open_v2(url.path, &db, SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX, nil) == SQLITE_OK { LoggingUtil.log(msg: "\(ContentFilestore.TAG): database file opened successfully") // You must enable foreign key constraints every time the db connects otherwise they're off by default and cascade deletes/fk's won't work sqlite3_exec(db, "PRAGMA foreign_keys = ON;", nil, nil, nil) } else { LoggingUtil.log(msg: "\(ContentFilestore.TAG) Error: unabled to open the database file") } return db; } Prior to iOA 17.2.1 we've never had an issue with this when a user's device upgraded the OS. Now this process continues to work without throwing an error or warning of any kind, but their FTS search db slows to a crawl. It also seems to be completely isolated to the FTS virtual table as well. The actual tables run just fine. My question is did something major change in iOS 17.2.1 >= that I'm missing that would be causing virtual tables to lose their indexing or have some kind of issue that would cause this problem?
3
0
342
Jan ’24