* Speed up the jobstatus query a little bit.

This commit is contained in:
Eelco Dolstra 2010-02-12 20:51:24 +00:00
parent d8cc0bbb5d
commit 12edc4b8e2

View file

@ -271,13 +271,16 @@ QUERY
x.nixExprPath, x.nixExprPath,
b.id as statusChangeId, b.timestamp as statusChangeTime b.id as statusChangeId, b.timestamp as statusChangeTime
from from
(select project, jobset, job, system, max(id) as id (select
(select max(id) from builds b
where
project = activeJobs.project and jobset = activeJobs.jobset
and job = activeJobs.job and system = activeJobs.system
and finished = 1
) as id
from $activeJobs as activeJobs from $activeJobs as activeJobs
natural join Builds ) as latest
where finished = 1 join Builds x using (id)
group by project, jobset, job, system)
as latest
natural join Builds x
$joinWithStatusChange $joinWithStatusChange
QUERY QUERY
); );