summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2010-10-18 21:27:28 +0000
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2010-10-18 21:27:28 +0000
commit3a31ddecc1b9b4f367f7408ccff519a0c843a019 (patch)
treeca64e8d13e4405293a0d7eb0a5b3141bd54ed7d3 /frontend
parent884338d20595cc165d2457afe36862d307c6ef36 (diff)
Add indices on the tko_tests.start_time and afe_jobs.created_on
Add indices on the tko_tests.start_time and afe_jobs.created_on columns. We query on these to process data for generating custom dashboards. Signed-off-by: Gregory Smith <gps@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@4863 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'frontend')
-rw-r--r--frontend/migrations/064_add_jobs_and_tests_time_indices.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/frontend/migrations/064_add_jobs_and_tests_time_indices.py b/frontend/migrations/064_add_jobs_and_tests_time_indices.py
new file mode 100644
index 00000000..3508bba3
--- /dev/null
+++ b/frontend/migrations/064_add_jobs_and_tests_time_indices.py
@@ -0,0 +1,10 @@
+# These indices speed up date-range queries often used in making dashboards.
+UP_SQL = """
+alter table tko_tests add index started_time (started_time);
+alter table afe_jobs add index created_on (created_on);
+"""
+
+DOWN_SQL = """
+drop index started_time on tko_tests;
+drop index created_on on afe_jobs;
+"""