From 08110044ea08c08165728abe6557ff9ce93b9922 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 3 Mar 2019 12:30:58 -0800 Subject: [PATCH] Create database index on searchRowID, which should make searching slightly faster. --- Frameworks/ArticlesDatabase/ArticlesDatabase.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Frameworks/ArticlesDatabase/ArticlesDatabase.swift b/Frameworks/ArticlesDatabase/ArticlesDatabase.swift index a7b4e6bda..314bc7c6d 100644 --- a/Frameworks/ArticlesDatabase/ArticlesDatabase.swift +++ b/Frameworks/ArticlesDatabase/ArticlesDatabase.swift @@ -35,6 +35,7 @@ public final class ArticlesDatabase { if !self.articlesTable.containsColumn("searchRowID", in: database) { 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;") } queue.vacuumIfNeeded()