Create database index on searchRowID, which should make searching slightly faster.

This commit is contained in:
Brent Simmons 2019-03-03 12:30:58 -08:00
parent ef9f2b1cdd
commit 08110044ea
1 changed files with 1 additions and 0 deletions

View File

@ -35,6 +35,7 @@ public final class ArticlesDatabase {
if !self.articlesTable.containsColumn("searchRowID", in: database) { if !self.articlesTable.containsColumn("searchRowID", in: database) {
database.executeStatements("ALTER TABLE articles add column searchRowID INTEGER;") database.executeStatements("ALTER TABLE articles add column searchRowID INTEGER;")
} }
database.executeStatements("CREATE INDEX if not EXISTS articles_searchRowID on articles(searchRowID);")
database.executeStatements("DROP TABLE if EXISTS tags;DROP INDEX if EXISTS tags_tagName_index;DROP INDEX if EXISTS articles_feedID_index;DROP INDEX if EXISTS statuses_read_index;") database.executeStatements("DROP TABLE if EXISTS tags;DROP INDEX if EXISTS tags_tagName_index;DROP INDEX if EXISTS articles_feedID_index;DROP INDEX if EXISTS statuses_read_index;")
} }
queue.vacuumIfNeeded() queue.vacuumIfNeeded()