From 3295b35c6ae677528fd8fae959859fcb23c69fa6 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Mon, 7 Aug 2017 16:46:27 +0200 Subject: [PATCH] imv-database: Improve performance by creating file_hashes index --- src/libimcv/imv/tables.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libimcv/imv/tables.sql b/src/libimcv/imv/tables.sql index 749eb609a5..8bde8898f9 100644 --- a/src/libimcv/imv/tables.sql +++ b/src/libimcv/imv/tables.sql @@ -48,6 +48,8 @@ CREATE TABLE file_hashes ( hash VARCHAR(64) NOT NULL, mutable INTEGER DEFAULT 0 ); +DROP INDEX IF EXISTS "file_hashes_idx"; +CREATE INDEX "file_hashes_idx" ON "file_hashes" ("file", "version", "algo"); DROP TABLE IF EXISTS groups; CREATE TABLE groups ( -- 2.47.2