From 41dd5e37820caf01c1027920232f30273d8aca6f Mon Sep 17 00:00:00 2001 From: Garvan Keeley Date: Tue, 16 Aug 2016 16:16:39 -0400 Subject: [PATCH] Make targets.host UNIQUE, which auto-creates index Done in regards to: https://github.com/brave/browser-ios/issues/310 Creating the index massively boosts performance for equality queries --- preload-httpse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preload-httpse.js b/preload-httpse.js index 7ba3eb7db4d..67a57ba110c 100644 --- a/preload-httpse.js +++ b/preload-httpse.js @@ -53,7 +53,7 @@ var db = new sqlite3.Database('httpse.sqlite', function (err) { db.exec(['DROP TABLE IF EXISTS rulesets', 'CREATE TABLE rulesets (id INTEGER PRIMARY KEY, contents TEXT)', 'DROP TABLE IF EXISTS targets', - 'CREATE TABLE targets (host TEXT, ids TEXT)'].join('; '), function (err) { + 'CREATE TABLE targets (host TEXT UNIQUE, ids TEXT)'].join('; '), function (err) { if (err !== null) { throw new Error('FATAL: could not create tables: ' + err) }