Speed up the listing of jobset evals by caching some info in the DB

This denormalises the database, but it's the best we can do until
PostgreSQL has materialised views.
This commit is contained in:
Eelco Dolstra 2012-04-16 00:46:19 +02:00
parent 034d50069b
commit aaacf9eda3

7
src/sql/upgrade-7.sql Normal file
View file

@ -0,0 +1,7 @@
alter table JobsetEvals
add column nrBuilds integer,
add column nrSucceeded integer;
update JobsetEvals e set
nrBuilds = (select count(*) from JobsetEvalMembers m where e.id = m.eval)
where hasNewBuilds = 1;