gitlab-org--gitlab-foss/app/controllers
Andreas Brandl 53801b1206
Preload routes information
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.
2019-09-03 12:16:03 +02:00
..
admin Preload routes information 2019-09-03 12:16:03 +02:00
boards Save board lists collapsed setting 2019-08-28 20:18:40 +00:00
ci
clusters
concerns Merge branch 'fix-peek-on-puma' into 'master' 2019-09-02 08:43:21 +00:00
dashboard Remove N+1 SQL query loading project feature in dashboard 2019-08-23 14:11:23 -07:00
explore
google_api
groups
import
instance_statistics
ldap
oauth
profiles
projects Avoid calling freeze on already frozen strings in app/controllers 2019-09-01 01:57:25 +05:30
sherlock
snippets
users
abuse_reports_controller.rb
acme_challenges_controller.rb
application_controller.rb Avoid calling freeze on already frozen strings in app/controllers 2019-09-01 01:57:25 +05:30
autocomplete_controller.rb
chaos_controller.rb
confirmations_controller.rb
dashboard_controller.rb
graphql_controller.rb
groups_controller.rb
health_check_controller.rb
health_controller.rb
help_controller.rb
ide_controller.rb
invites_controller.rb
jwt_controller.rb
metrics_controller.rb
notification_settings_controller.rb
omniauth_callbacks_controller.rb
passwords_controller.rb
profiles_controller.rb
projects_controller.rb
registrations_controller.rb
root_controller.rb
search_controller.rb
sent_notifications_controller.rb
sessions_controller.rb Avoid calling freeze on already frozen strings in app/controllers 2019-09-01 01:57:25 +05:30
snippets_controller.rb
uploads_controller.rb Add direct upload support for personal snippets 2019-08-23 11:19:14 +02:00
user_callouts_controller.rb
users_controller.rb