]> xenbits.xensource.com Git - osstest.git/commitdiff
schema: Provide index on flights by start time
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 19 Aug 2020 14:59:09 +0000 (15:59 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 20 Aug 2020 13:24:08 +0000 (14:24 +0100)
We often use flight number as a proxy for ordering, but this is not
always appropriate and not always done (and sometimes it's a bit of a
bodge).

Provide an index to find flights by start time.  This significantly
speeds up the host allocation $equivstatusq query, and the duration
estimator.

(I have tested this by creating a trial index in the production
database.  That index can be dropped again, preferably after this
commit makes it to production.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
schema/flights-started-index.sql [new file with mode: 0644]

diff --git a/schema/flights-started-index.sql b/schema/flights-started-index.sql
new file mode 100644 (file)
index 0000000..c230d9d
--- /dev/null
@@ -0,0 +1,7 @@
+-- ##OSSTEST## 011 Harmless
+--
+-- This index helps ts-hosts-allocate-Executive find recent instances
+-- of the same job.  It may be useful for other things too.
+
+CREATE INDEX flights_blessing_started_idx
+    ON flights (blessing, started);