From b0257acf96f39f27da4c2fadddf85a457fd5eb1f Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Mon, 13 Jan 2020 20:00:39 +0100
Subject: schema.sql: index builds on source

The per-source page rendered by webapp.py incurs a lot of query that can
be sped up using this index.
---
 schema.sql | 1 +
 1 file changed, 1 insertion(+)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index d7854a2..c785080 100644
--- a/schema.sql
+++ b/schema.sql
@@ -30,6 +30,7 @@ CREATE TABLE builds (
 	success BOOLEAN NOT NULL CHECK (success in (0, 1)),
 	starttime TIMESTAMP NOT NULL,
 	filename TEXT NOT NULL);
+CREATE INDEX builds_source_index ON builds(source);
 
 CREATE TABLE buildrequests (
 	id INTEGER PRIMARY KEY,
-- 
cgit v1.2.3

