Improve performance of Search API (Advanced): merge_requests scope
Summary
In &3166 (closed) a performance issue was raised around the response time of the Advanced Search API. This issue deals specifically with the merge_requests
scope, at the Global, Group, and Project levels. Below are results of a performance test that was run on the 10k reference architecture:
API - Global Search
✓ { endpoint:merge_requests }...: avg=12918.47ms min=676.77ms med=15311.66ms max=18461.20ms p(90)=17391.88ms p(95)=17597.13ms
API - Group Search
✓ { endpoint:merge_requests }...: avg=17478.69ms min=5739.88ms med=17262.29ms max=29998.81ms p(90)=24194.73ms p(95)=26859.02ms
API - Project Search
✓ { endpoint:merge_requests }...: avg=13000.86ms min=8454.13ms med=13264.80ms max=17228.14ms p(90)=14535.82ms p(95)=15225.50ms
Improvements
Global
Queries
Started GET "/api/v4/search?scope=merge_requests&search=*"
PersonalAccessToken Load (0.3ms) SELECT "personal_access_tokens".* FROM "personal_access_tokens" WHERE "personal_access_tokens"."token_digest" = '' LIMIT 1
↳ app/models/concerns/token_authenticatable_strategies/digest.rb:8:in `find_token_authenticatable'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
↳ lib/gitlab/auth/auth_finders.rb:103:in `find_user_from_access_token'
License Load (0.3ms) SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 1
↳ ee/app/models/license.rb:268:in `load_license'
MergeRequest Search (4.3ms) {index: "gitlab-development", type: "doc", body: {query: {bool: {must: [{simple_query_string: {fields: ["title^2", "description"], query: "*", default_operator: :and}}], filter: [{term: {type: "merge_request"}}, {has_parent: {parent_type: "project", query: {bool: {should: [[{bool: {filter: [{term: {visibility_level: 0}}, {terms: {"merge_requests_access_level"=>[20, 10]}}]}}], [{bool: {filter: [{term: {visibility_level: 10}}, {terms: {"merge_requests_access_level"=>[20, 10]}}]}}], [{bool: {filter: [{term: {visibility_level: 20}}, {terms: {"merge_requests_access_level"=>[20, 10]}}]}}]]}}}}]}}, sort: [{updated_at: {order: :desc}}, :_score], highlight: {fields: {title: {}, description: {}}}}, size: 20, from: 0}
(0.5ms) SELECT COUNT(*) FROM "merge_requests" WHERE "merge_requests"."id" IN (28, 24, 23, 22, 29, 3, 1, 32, 31, 30, 27, 26, 25, 21, 20, 19, 18, 17, 16, 15)
↳ ee/lib/gitlab/elastic/search_results.rb:172:in `eager_load'
MergeRequest Load (0.5ms) SELECT "merge_requests".* FROM "merge_requests" WHERE "merge_requests"."id" IN (28, 24, 23, 22, 29, 3, 1, 32, 31, 30, 27, 26, 25, 21, 20, 19, 18, 17, 16, 15)
↳ ee/lib/gitlab/elastic/search_results.rb:172:in `eager_load'
Project Load (0.8ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" IN (1, 3, 5, 6, 7, 8)
↳ ee/lib/gitlab/elastic/search_results.rb:172:in `eager_load'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" IN (1, 3, 8, 7, 5, 6)
↳ ee/lib/gitlab/elastic/search_results.rb:172:in `eager_load'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" IN (22, 23, 28, 27, 25, 26)
↳ ee/lib/gitlab/elastic/search_results.rb:172:in `eager_load'
ProjectFeature Load (0.3ms) SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 1 LIMIT 1
↳ app/policies/project_policy.rb:539:in `feature_available?'
ProjectFeature Load (0.4ms) SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 3 LIMIT 1
↳ app/policies/project_policy.rb:539:in `feature_available?'
ProjectFeature Load (0.3ms) SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 5 LIMIT 1
↳ app/policies/project_policy.rb:539:in `feature_available?'
ProjectFeature Load (0.3ms) SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 6 LIMIT 1
↳ app/policies/project_policy.rb:539:in `feature_available?'
ProjectFeature Load (0.2ms) SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 7 LIMIT 1
↳ app/policies/project_policy.rb:539:in `feature_available?'
ProjectFeature Load (0.3ms) SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 8 LIMIT 1
↳ app/policies/project_policy.rb:539:in `feature_available?'
Project Load (0.7ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 32 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 32 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 32 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 32 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 32 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 32
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.4ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 32 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 32 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 22 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
Timelog Load (0.3ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 32
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 3 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 3 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 3 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 3 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.9ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 3 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 21 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 3
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 3 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 2 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 22 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 22 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 3 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 3
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 15 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 15 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 15 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 15 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 15 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 15
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 15 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 11 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 15 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 15
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 16 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 16 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 16 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 16 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 16 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 19 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 16
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 16 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 12 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 16 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 16
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 17 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 17 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 17 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 17 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 17 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 17
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 17 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 12 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 17 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 17
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 18 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 18 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 18 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 18 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 18 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 19 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 18
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.3ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 18 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 11 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 18 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 18
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 19 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.2ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 19 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 19 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 19 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 19 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 17 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.4ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 19
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.3ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 19 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 11 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 19 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 19
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 20 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 20 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 20 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 20 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 20 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.4ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 20
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.3ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 20 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 15 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 20 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 20
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 21 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.2ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 21 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 21 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 21 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 21 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 19 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.4ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 21
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.3ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 21 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 15 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 3 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 23 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 23 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 21 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.3ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 21
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 22 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.2ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 22 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 22 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 22 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 22 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 22
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.3ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 22 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 23 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 25 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 25 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 22 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 25 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 22
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 23 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.2ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 23 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 23 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 23 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 23 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 20 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.4ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 23
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.4ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 23 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 21 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 25 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 25 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 23 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 23
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 24 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.4ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 24 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 24 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 24 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 24 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 20 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.4ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 24
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.3ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 24 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 25 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.4ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 5 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 25 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 25 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.4ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 24 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.3ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 24
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 25 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.4ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 25 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.4ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 25 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 25 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 25 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 7 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 25
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 25 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 26 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 26 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 25 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 25
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.4ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 26 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 26 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 26 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 26 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 26 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 19 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 26
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 26 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 29 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 26 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.4ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 26 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 26
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 27 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 27 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 27 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 27 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.8ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 27 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 7 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 27
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 27 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 26 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 26 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 27 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 27
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 28 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.4ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 28 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 28 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 28 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 28 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 19 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 28
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.5ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 28 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 27 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.4ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 26 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.3ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 28 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 28
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 7 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 29 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.4ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 29 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 29 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.3ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 29 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.7ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 29 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 21 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 29
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.4ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 29 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.2ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 34 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 7 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 27 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 27 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 29 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 27 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 29
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 8 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.2ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 30 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 30 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 30 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 30 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 30 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 21 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 30
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.4ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 30 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 40 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.7ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 8 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.2ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 30 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 30
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.7ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.4ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 31 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 31 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 31 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 31 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 31 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 31
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.4ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 31 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 31 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 31
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
↳ app/models/merge_request.rb:1004:in `for_fork?'
MergeRequest::Metrics Load (0.3ms) SELECT "merge_request_metrics".* FROM "merge_request_metrics" WHERE "merge_request_metrics"."merge_request_id" = 1 LIMIT 1
↳ lib/api/entities/merge_request_basic.rb:7:in `block in <class:MergeRequestBasic>'
(0.3ms) SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 1 AND "notes"."noteable_type" = 'MergeRequest' AND "notes"."system" = FALSE
↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 1 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsup'
↳ app/models/concerns/awardable.rb:93:in `upvotes'
(0.2ms) SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 1 AND "award_emoji"."awardable_type" = 'MergeRequest' AND "award_emoji"."name" = 'thumbsdown'
↳ app/models/concerns/awardable.rb:89:in `downvotes'
User Load (0.6ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 1 ORDER BY "users"."id" ASC LIMIT 1
↳ app/models/concerns/deprecated_assignee.rb:29:in `assignee'
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 20 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "merge_request_assignees" ON "users"."id" = "merge_request_assignees"."user_id" WHERE "merge_request_assignees"."merge_request_id" = 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Label Load (0.4ms) SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 1 AND "label_links"."target_type" = 'MergeRequest' ORDER BY "labels"."title" ASC
↳ lib/api/entities/merge_request_basic.rb:42:in `map'
Milestone Load (0.3ms) SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 3 LIMIT 1
↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1
↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
Namespace Load (0.3ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 22 LIMIT 1
↳ config/application.rb:309:in `block (4 levels) in <class:Application>'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 22 AND "routes"."source_type" = 'Namespace' LIMIT 1
↳ app/models/concerns/routable.rb:77:in `full_path'
MergeRequestDiff Load (0.2ms) SELECT "merge_request_diffs".* FROM "merge_request_diffs" WHERE "merge_request_diffs"."id" = 1 LIMIT 1
↳ app/models/concerns/manual_inverse_association.rb:9:in `block in manual_inverse_association'
Timelog Load (0.2ms) SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."merge_request_id" = 1
↳ lib/api/entities/issuable_time_stats.rb:21:in `map'
312 queries performed, including N+1 queries for the following associations:
- merge_request_assignees
- merge_request_diffs
- labels
- timelogs
- projects
- merge_request_metrics
- namespaces
- routes
- COUNT of notes
- COUNT of upvotes
- COUNT of downvotes
A ProjectFeature
query is performed for every project in the results. These can be combined into a single query.
Optimizing this will also improve Group and Project levels, as they do not override eager-loading behaviour.
Edited by 🤖 GitLab Bot 🤖