From 8530f2bf2eec7b23648a930b8b7dc837cd14c6c5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 24 Jul 2020 14:54:32 +0100 Subject: [PATCH] schema: Add index for quick lookup by host Signed-off-by: Ian Jackson --- v2: Use proper \ escaping for underscores in LIKE --- schema/runvars-host-index.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 schema/runvars-host-index.sql diff --git a/schema/runvars-host-index.sql b/schema/runvars-host-index.sql new file mode 100644 index 0000000..222a0a3 --- /dev/null +++ b/schema/runvars-host-index.sql @@ -0,0 +1,8 @@ +-- ##OSSTEST## 009 Preparatory +-- +-- This index helps sg-report-host-history find relevant flights. + +CREATE INDEX runvars_host_idx + ON runvars (val, flight) + WHERE name ='host' + OR name LIKE '%\_host'; -- 2.39.5