Skip to content

N+1 in tags list view

https://gitlab.com/gitlab-org/gitlab/-/tags repeats the same query 40 times:

SELECT "protected_tags"."name" FROM "protected_tags" WHERE "protected_tags"."project_id" = 278964 

Screen_Shot_2020-10-30_at_8.20.49_PM

Details

[
  "app/models/concerns/protected_ref.rb:62:in `matching'",
  "app/models/protected_tag.rb:13:in `protected?'",
  "app/helpers/tags_helper.rb:29:in `protected_tag?'",
  "app/views/projects/tags/_tag.html.haml:9",
  "app/views/projects/tags/index.html.haml:37",
  "app/controllers/application_controller.rb:134:in `render'",
  "ee/lib/gitlab/ip_address_state.rb:10:in `with'",
  "ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address'",
  "app/controllers/application_controller.rb:493:in `set_current_admin'",
  "lib/gitlab/session.rb:11:in `with_session'",
  "app/controllers/application_controller.rb:484:in `set_session_storage'",
  "app/controllers/application_controller.rb:478:in `set_locale'",
  "lib/gitlab/error_tracking.rb:52:in `with_context'",
  "app/controllers/application_controller.rb:543:in `sentry_context'",
  "app/controllers/application_controller.rb:471:in `block in set_current_context'",
  "lib/gitlab/application_context.rb:54:in `block in use'",
  "lib/gitlab/application_context.rb:54:in `use'",
  "lib/gitlab/application_context.rb:21:in `with_context'",
  "app/controllers/application_controller.rb:463:in `set_current_context'",
  "ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase'",
  "lib/gitlab/jira/middleware.rb:19:in `call'"
]
Edited by Thong Kuah