N+1 SQL queries in PipelinesController#show checking artifacts
From !21000 (merged), we seem to have an N+1 query loading Ci::Build#artifacts?
. This is originating from https://gitlab.com/gitlab-org/gitlab-ee/blob/2d9e0f3ffb59a4323e794fcc4bf122274c82c67f/app/views/projects/ci/builds/_build.html.haml#L99:
[
"app/models/ci/build.rb:593:in `artifacts_file'",
"app/models/ci/build.rb:605:in `artifacts?'",
"app/views/projects/ci/builds/_build.html.haml:99:in `_app_views_projects_ci_builds__build_html_haml___3728230498159233337_70343814444760'",
"app/views/projects/stage/_stage.html.haml:11:in `_app_views_projects_stage__stage_html_haml___901203011518743519_70344738851940'",
"app/views/projects/pipelines/_with_tabs.html.haml:40:in `_app_views_projects_pipelines__with_tabs_html_haml__2773660735256188773_70344633497340'",
"app/views/projects/pipelines/show.html.haml:21:in `_app_views_projects_pipelines_show_html_haml__4313444857854559199_70344719384640'",
"app/controllers/application_controller.rb:120:in `render'",
"app/controllers/projects/pipelines_controller.rb:189:in `block (2 levels) in render_show'",
"app/controllers/projects/pipelines_controller.rb:187:in `render_show'",
"app/controllers/projects/pipelines_controller.rb:85:in `builds'",
"ee/lib/gitlab/ip_address_state.rb:10:in `with'",
"ee/app/controllers/ee/application_controller.rb:43:in `set_current_ip_address'",
"lib/gitlab/session.rb:11:in `with_session'",
"app/controllers/application_controller.rb:462:in `set_session_storage'",
"app/controllers/application_controller.rb:456:in `set_locale'",
"ee/lib/gitlab/jira/middleware.rb:19:in `call'"
]