Add INDEX for lastSeen column
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 28 Sep 2020 15:00:29 +0000 (17:00 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 28 Sep 2020 15:00:29 +0000 (17:00 +0200)
src/blacklist.ts

index acd9aae63f54ac361a7c33726f0e101fce47f9d8..2c8439eca729c226561e23ac8eaeee76b54ee355 100644 (file)
@@ -23,6 +23,12 @@ export class Blacklist {
         this.tableName
       } (hash);`,
     );
+
+    await this.db.exec(
+      `CREATE INDEX IF NOT EXISTS lastSeen_${this.type} ON ${
+        this.tableName
+      } (lastSeen);`,
+    );
   }
 
   public async upsert(buffer: Buffer): Promise<void> {