From 84acccb3ea7af201e4ae1404c13c1fe0040eab69 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 12 Aug 2013 20:16:28 +0200 Subject: [PATCH] Index builds on stop time This is necessary to make the /all page fast, since it sorts builds on descending stop time. --- src/sql/hydra.sql | 1 + src/sql/upgrade-18.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 src/sql/upgrade-18.sql diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 4562dc41..3001ab10 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -564,6 +564,7 @@ create index IndexBuildsOnJobAndSystem on Builds(project, jobset, job, system); create index IndexBuildsOnJobset on Builds(project, jobset); create index IndexBuildsOnProject on Builds(project); create index IndexBuildsOnTimestamp on Builds(timestamp); +create index IndexBuildsOnFinishedStopTime on Builds(finished, stoptime DESC); create index IndexBuildsOnJobsetFinishedTimestamp on Builds(project, jobset, finished, timestamp DESC); -- obsolete? create index IndexBuildsOnJobFinishedId on builds(project, jobset, job, system, finished, id DESC); create index IndexBuildsOnJobSystemCurrent on Builds(project, jobset, job, system, isCurrent); diff --git a/src/sql/upgrade-18.sql b/src/sql/upgrade-18.sql new file mode 100644 index 00000000..acd1f397 --- /dev/null +++ b/src/sql/upgrade-18.sql @@ -0,0 +1 @@ +create index IndexBuildsOnFinishedStopTime on Builds(finished, stoptime DESC);