You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The job_inputs query that we use to grab all the inputs for the dashboard can end up getting slow with a really large deployment where lots of users are always keeping the dashboard open. I saw that for one deployment this query made up a few of the top queries that were taking up the most total time from the db.
rows, err:=psql.Select("j.id", "i.name", "r.name", "array_agg(jp.name ORDER BY jp.id)", "i.trigger").
From("job_inputs i").
Join("jobs j ON j.id = i.job_id").
Join("pipelines p ON p.id = j.pipeline_id").
Join("teams tm ON tm.id = p.team_id").
Join("resources r ON r.id = i.resource_id").
LeftJoin("jobs jp ON jp.id = i.passed_job_id").
Where(sq.Eq{
"j.active": true,
}).
Where(d.pred).
GroupBy("i.name, j.id, r.name, i.trigger").
OrderBy("j.id").
RunWith(d.tx).
Query()
Looks like a lot of the time is being used by the group by which is needed because of the array_agg. Maybe we can not do the array_agg and just combine the passed_job_ids in the atc manually for each input?
Another query was also taking up a lot of time was
Summary
The
job_inputs
query that we use to grab all the inputs for the dashboard can end up getting slow with a really large deployment where lots of users are always keeping the dashboard open. I saw that for one deployment this query made up a few of the top queries that were taking up the most total time from the db.concourse/atc/db/job_factory.go
Lines 437 to 451 in 752fd43
Looks like a lot of the time is being used by the
group by
which is needed because of thearray_agg
. Maybe we can not do thearray_agg
and just combine thepassed_job_id
s in the atc manually for each input?Another query was also taking up a lot of time was
concourse/atc/db/job_factory.go
Lines 311 to 338 in 752fd43
Context
The text was updated successfully, but these errors were encountered: