-
Stan Hu authored
https://gitlab.com/gitlab-org/gitlab/merge_requests/20615 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: 1. user 2. latest_statuses_ordered_by_stage 3. failed_builds 4. failed_builds metadata Closes https://gitlab.com/gitlab-org/gitlab/issues/118427
ea971ad6