Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Make targets.host UNIQUE, which auto-creates index
Browse files Browse the repository at this point in the history
Done in regards to: https://github.com/brave/browser-ios/issues/310
Creating the index massively boosts performance for equality queries
  • Loading branch information
garvankeeley authored Aug 16, 2016
1 parent cf76ac5 commit 41dd5e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion preload-httpse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 41dd5e3

Please sign in to comment.