hydra/src/sql/upgrade-7.sql
Eelco Dolstra aaacf9eda3 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.
2012-04-16 00:46:19 +02:00

8 lines
225 B
SQL

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;