Eliminate N+1 queries in PipelinesController#index
!20615 (merged) introduced a
performance regression: each failed build would generate additional SQL
queries, since they would be rendered by JobEntity
. This commit fixes
that by preloading failed builds among other items and adds an N+1 query
test. This adds 4 additional queries per pipeline:
- user
- latest_statuses_ordered_by_stage
- failed_builds
- failed_builds metadata
Closes #118427 (closed)
Edited by Stan Hu