N+1 SQL queries when attempting to create a merge request from a commonly-forked repo

  1. I attempted to create a merge request my fork of gitlab-org/gitlab.
  2. I changed branches and it took a while to load:

Attached is the profiler bar data:

image

image

[
  "config/application.rb:288:in `block (4 levels) in <class:Application>'",
  "app/views/projects/merge_requests/dropdowns/_project.html.haml:4:in `block in _app_views_projects_merge_requests_dropdowns__project_html_haml___2371740320200575363_70298719276760'",
  "app/views/projects/merge_requests/dropdowns/_project.html.haml:2:in `_app_views_projects_merge_requests_dropdowns__project_html_haml___2371740320200575363_70298719276760'",
  "app/views/projects/merge_requests/creations/_new_compare.html.haml:49:in `block (2 levels) in _app_views_projects_merge_requests_creations__new_compare_html_haml___4275440710166303194_70298690238300'",
  "app/helpers/dropdowns_helper.rb:105:in `block in dropdown_content'",
  "app/helpers/dropdowns_helper.rb:103:in `dropdown_content'",
  "app/views/projects/merge_requests/creations/_new_compare.html.haml:48:in `block in _app_views_projects_merge_requests_creations__new_compare_html_haml___4275440710166303194_70298690238300'",
  "app/views/projects/merge_requests/creations/_new_compare.html.haml:4:in `_app_views_projects_merge_requests_creations__new_compare_html_haml___4275440710166303194_70298690238300'",
  "app/views/projects/merge_requests/creations/new.html.haml:8:in `_app_views_projects_merge_requests_creations_new_html_haml___270026144065108126_70298738977480'",
  "app/controllers/application_controller.rb:120:in `render'",
  "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/omni_auth/strategies/group_saml.rb:41:in `other_phase'",
  "ee/lib/gitlab/jira/middleware.rb:19:in `call'"
]

new.zip

Edited Jun 17, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading