diff mbox series

[OSSTEST,7/7] schema: Provide index on flights by start time

Message ID 20200819160143.11178-8-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series host allocation: Performance improvements | expand

Commit Message

Ian Jackson Aug. 19, 2020, 4:01 p.m. UTC
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 | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 schema/flights-started-index.sql
diff mbox series

Patch

diff --git a/schema/flights-started-index.sql b/schema/flights-started-index.sql
new file mode 100644
index 00000000..c230d9d8
--- /dev/null
+++ b/schema/flights-started-index.sql
@@ -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);