53801b1206
This fixes a high frequency N+1 issue: `RoutableActions#find_routable!` is used across many controllers to retrieve e.g. the Project or Namespace by path. The `#find_routable!` method calls `#ensure_canonical_path` which in turn retrieves `#full_path` from the given Routable. This in turn triggers a lookup on `routes`, leading to a high frequency of these queries: ```sql SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND "routes"."source_type" = $2 LIMIT $3 ``` This is unnecessary as we already join `routes` in `Routable#find_by_full_path` anyways. |
||
---|---|---|
.. | ||
clusters | ||
abuse_reports_controller.rb | ||
appearances_controller.rb | ||
application_controller.rb | ||
application_settings_controller.rb | ||
applications_controller.rb | ||
background_jobs_controller.rb | ||
broadcast_messages_controller.rb | ||
clusters_controller.rb | ||
dashboard_controller.rb | ||
deploy_keys_controller.rb | ||
gitaly_servers_controller.rb | ||
groups_controller.rb | ||
health_check_controller.rb | ||
hook_logs_controller.rb | ||
hooks_controller.rb | ||
identities_controller.rb | ||
impersonation_tokens_controller.rb | ||
impersonations_controller.rb | ||
jobs_controller.rb | ||
keys_controller.rb | ||
labels_controller.rb | ||
logs_controller.rb | ||
projects_controller.rb | ||
requests_profiles_controller.rb | ||
runner_projects_controller.rb | ||
runners_controller.rb | ||
services_controller.rb | ||
spam_logs_controller.rb | ||
system_info_controller.rb | ||
users_controller.rb |