Skip to content

Advanced Search API (Issues scope): Preload more associations to reduce N+1 queries

Alishan Ladhani requested to merge ali/refactor-api-search-issue-preloads into master

What does this MR do?

Part of #215712 (closed).

As a follow-up to !30233 (merged), use a scope to preload more API-specific associations. Suggested in &3166 (comment 333689229).

Issue.with_api_entity_associations already exists, and looks like:

scope :with_api_entity_associations, -> { preload(:timelogs, :assignees, :author, :notes, :labels, project: [:route, { namespace: :route }] ) }

List of queries for a page of 20 results from the Global search endpoint:

Before (156 queries)
Started GET "/api/v4/search?scope=issues&search=*"
   (0.2ms)  SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::float as lag
  ↳ app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
  ApplicationSetting Load (0.9ms)  SELECT "application_settings".* FROM "application_settings" ORDER BY "application_settings"."id" DESC LIMIT 1
  ↳ app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
  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.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  ↳ lib/gitlab/auth/auth_finders.rb:101:in `find_user_from_access_token'
   (0.2ms)  SELECT "features"."key" FROM "features"
  ↳ lib/feature.rb:15:in `feature_names'
  License Load (0.2ms)  SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 1
  ↳ ee/app/models/license.rb:269:in `load_license'
  Issue Search (8.5ms) {index: "gitlab-development", type: "doc", body: {query: {bool: {must: [{simple_query_string: {fields: ["title^2", "description"], query: "*", default_operator: :and}}], filter: [{term: {type: "issue"}}, {has_parent: {parent_type: "project", query: {bool: {should: [[{bool: {filter: [{term: {visibility_level: 0}}, {terms: {"issues_access_level"=>[20, 10]}}]}}], [{bool: {filter: [{term: {visibility_level: 10}}, {terms: {"issues_access_level"=>[20, 10]}}]}}], [{bool: {filter: [{term: {visibility_level: 20}}, {terms: {"issues_access_level"=>[20, 10]}}]}}]]}}}}]}}, sort: [{updated_at: {order: :desc}}, :_score], highlight: {fields: {title: {}, description: {}}}}, size: 20, from: 0}
   (0.6ms)  SELECT COUNT(*) FROM "issues" WHERE "issues"."id" IN (450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 77, 76, 75, 74, 73, 72, 71)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Issue Load (0.6ms)  SELECT "issues".* FROM "issues" WHERE "issues"."id" IN (450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 77, 76, 75, 74, 73, 72, 71)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Project Load (0.8ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" IN (8, 4, 1, 7, 19)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Route Load (0.4ms)  SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" IN (1, 4, 8, 7, 19)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Namespace Load (0.5ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" IN (22, 24, 28, 27, 1)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  LabelLink Load (0.4ms)  SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Label Load (0.3ms)  SELECT "labels".* FROM "labels" WHERE "labels"."id" IN (65, 64) ORDER BY "labels"."title" ASC
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Timelog Load (0.3ms)  SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."issue_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  IssueAssignee Load (0.3ms)  SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."issue_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 21, 18)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  ProjectFeature Load (0.4ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 19 LIMIT 1
  ↳ app/policies/project_policy.rb:540: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:540:in `feature_available?'
  ProjectFeature Load (0.4ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 4 LIMIT 1
  ↳ app/policies/project_policy.rb:540:in `feature_available?'
  Group Load (0.5ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 24 AND "namespaces"."type" = 'Group' LIMIT 1
  ↳ ee/app/policies/ee/project_policy.rb:304:in `block (2 levels) in <module:ProjectPolicy>'
  Group Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 24 AND "namespaces"."parent_id" IS NULL LIMIT 1
  ↳ app/models/namespace.rb:280:in `block in root_ancestor'
  ProjectFeature Load (0.4ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 1 LIMIT 1
  ↳ app/policies/project_policy.rb:540:in `feature_available?'
  ProjectFeature Load (0.4ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 7 LIMIT 1
  ↳ app/policies/project_policy.rb:540:in `feature_available?'
  User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.5ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 450 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 450 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 450 AND "award_emoji"."awardable_type" = 'Issue' 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" = 450 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Route Load (0.3ms)  SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 1 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 39 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.4ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 72 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 72 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 72 AND "award_emoji"."awardable_type" = 'Issue' 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" = 72 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 38 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  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'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 73 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 73 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 73 AND "award_emoji"."awardable_type" = 'Issue' 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" = 73 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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.6ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  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'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 74 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 74 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 74 AND "award_emoji"."awardable_type" = 'Issue' 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" = 74 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 37 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  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'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 75 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 75 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 75 AND "award_emoji"."awardable_type" = 'Issue' 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" = 75 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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.6ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 76 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 76 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 76 AND "award_emoji"."awardable_type" = 'Issue' 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" = 76 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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.6ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  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'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 77 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 77 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 77 AND "award_emoji"."awardable_type" = 'Issue' 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" = 77 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.4ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 438 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 438 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 438 AND "award_emoji"."awardable_type" = 'Issue' 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" = 438 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Route Load (0.3ms)  SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 24 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 439 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 439 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 439 AND "award_emoji"."awardable_type" = 'Issue' 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" = 439 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 440 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 440 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 440 AND "award_emoji"."awardable_type" = 'Issue' 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" = 440 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 441 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.5ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 441 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 441 AND "award_emoji"."awardable_type" = 'Issue' 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" = 441 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Route Load (0.2ms)  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'
  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'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 442 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.5ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 442 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 442 AND "award_emoji"."awardable_type" = 'Issue' 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" = 442 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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'
   (0.2ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 443 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 443 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 443 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsup'
  ↳ app/models/concerns/awardable.rb:93:in `upvotes'
   (2.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 443 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.3ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 444 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.5ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 444 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 444 AND "award_emoji"."awardable_type" = 'Issue' 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" = 444 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.6ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 445 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 445 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 445 AND "award_emoji"."awardable_type" = 'Issue' 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" = 445 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.4ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 446 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 446 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 446 AND "award_emoji"."awardable_type" = 'Issue' 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" = 446 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.8ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 447 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.7ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 447 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 447 AND "award_emoji"."awardable_type" = 'Issue' 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" = 447 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Route Load (0.3ms)  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'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.4ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 448 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 448 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 448 AND "award_emoji"."awardable_type" = 'Issue' 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" = 448 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.4ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 449 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 449 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 449 AND "award_emoji"."awardable_type" = 'Issue' 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" = 449 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 37 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
  User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
  ↳ ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
   (0.4ms)  SELECT COUNT(*) FROM "notes" WHERE "notes"."noteable_id" = 71 AND "notes"."noteable_type" = 'Issue' AND "notes"."system" = FALSE
  ↳ app/models/concerns/issuable.rb:375:in `user_notes_count'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 71 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 71 AND "award_emoji"."awardable_type" = 'Issue' 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" = 71 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
After (115 queries)
Started GET "/api/v4/search?scope=issues&search=*"
  ApplicationSetting Load (0.8ms)  SELECT "application_settings".* FROM "application_settings" ORDER BY "application_settings"."id" DESC LIMIT 1
  ↳ app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
  PersonalAccessToken Load (0.2ms)  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.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  ↳ lib/gitlab/auth/auth_finders.rb:101:in `find_user_from_access_token'
   (0.2ms)  SELECT "features"."key" FROM "features"
  ↳ lib/feature.rb:15:in `feature_names'
  License Load (0.3ms)  SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 1
  ↳ ee/app/models/license.rb:269:in `load_license'
  Issue Search (6.8ms) {index: "gitlab-development", type: "doc", body: {query: {bool: {must: [{simple_query_string: {fields: ["title^2", "description"], query: "*", default_operator: :and}}], filter: [{term: {type: "issue"}}, {has_parent: {parent_type: "project", query: {bool: {should: [[{bool: {filter: [{term: {visibility_level: 0}}, {terms: {"issues_access_level"=>[20, 10]}}]}}], [{bool: {filter: [{term: {visibility_level: 10}}, {terms: {"issues_access_level"=>[20, 10]}}]}}], [{bool: {filter: [{term: {visibility_level: 20}}, {terms: {"issues_access_level"=>[20, 10]}}]}}]]}}}}]}}, sort: [{updated_at: {order: :desc}}, :_score], highlight: {fields: {title: {}, description: {}}}}, size: 20, from: 0}
   (0.5ms)  SELECT COUNT(*) FROM "issues" WHERE "issues"."id" IN (450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 77, 76, 75, 74, 73, 72, 71)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Issue Load (0.5ms)  SELECT "issues".* FROM "issues" WHERE "issues"."id" IN (450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 77, 76, 75, 74, 73, 72, 71)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Timelog Load (0.4ms)  SELECT "timelogs".* FROM "timelogs" WHERE "timelogs"."issue_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  IssueAssignee Load (0.4ms)  SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."issue_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 21, 18)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 1, 2, 3)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Note Load (0.6ms)  SELECT "notes".* FROM "notes" WHERE "notes"."noteable_type" = 'Issue' AND "notes"."noteable_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  LabelLink Load (0.4ms)  SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Label Load (0.3ms)  SELECT "labels".* FROM "labels" WHERE "labels"."id" IN (65, 64) ORDER BY "labels"."title" ASC
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Project Load (0.6ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" IN (8, 4, 1, 7, 19)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Route Load (0.3ms)  SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" IN (1, 4, 8, 7, 19)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" IN (22, 24, 28, 27, 1)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  Route Load (0.3ms)  SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" IN (1, 28, 27, 24, 22)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  EpicIssue Load (0.2ms)  SELECT "epic_issues".* FROM "epic_issues" WHERE "epic_issues"."issue_id" IN (71, 72, 73, 74, 75, 76, 77, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450)
  ↳ ee/lib/gitlab/elastic/search_results.rb:173:in `eager_load'
  ProjectFeature Load (0.2ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 19 LIMIT 1
  ↳ app/policies/project_policy.rb:540: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:540:in `feature_available?'
  ProjectFeature Load (0.2ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 4 LIMIT 1
  ↳ app/policies/project_policy.rb:540:in `feature_available?'
  Group Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 24 AND "namespaces"."type" = 'Group' LIMIT 1
  ↳ ee/app/policies/ee/project_policy.rb:304:in `block (2 levels) in <module:ProjectPolicy>'
  Group Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 24 AND "namespaces"."parent_id" IS NULL LIMIT 1
  ↳ app/models/namespace.rb:280:in `block in root_ancestor'
  ProjectFeature Load (0.3ms)  SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 1 LIMIT 1
  ↳ app/policies/project_policy.rb:540: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:540:in `feature_available?'
  GeoNode Exists? (0.5ms)  SELECT 1 AS one FROM "geo_nodes" LIMIT 1
  ↳ ee/lib/gitlab/geo.rb:36:in `block in enabled?'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 450 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 450 AND "award_emoji"."awardable_type" = 'Issue' 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" = 450 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 39 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 72 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 72 AND "award_emoji"."awardable_type" = 'Issue' 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" = 72 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 38 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 73 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 73 AND "award_emoji"."awardable_type" = 'Issue' 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" = 73 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  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.6ms)  SELECT "projects".* FROM "projects" WHERE "projects"."id" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 74 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.3ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 74 AND "award_emoji"."awardable_type" = 'Issue' 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" = 74 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.3ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 37 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" = 8 LIMIT 1
  ↳ app/helpers/milestones_routing_helper.rb:16:in `milestone_url'
  Namespace Load (0.4ms)  SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 28 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" = 28 AND "routes"."source_type" = 'Namespace' LIMIT 1
  ↳ app/models/concerns/routable.rb:77:in `full_path'
   (0.5ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 75 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 75 AND "award_emoji"."awardable_type" = 'Issue' 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" = 75 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.2ms)  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.5ms)  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'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 76 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 76 AND "award_emoji"."awardable_type" = 'Issue' 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" = 76 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.2ms)  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.4ms)  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'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 77 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 77 AND "award_emoji"."awardable_type" = 'Issue' 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" = 77 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 438 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 438 AND "award_emoji"."awardable_type" = 'Issue' 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" = 438 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.5ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 439 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 439 AND "award_emoji"."awardable_type" = 'Issue' 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" = 439 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 440 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 440 AND "award_emoji"."awardable_type" = 'Issue' 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" = 440 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 441 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 441 AND "award_emoji"."awardable_type" = 'Issue' 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" = 441 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 442 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 442 AND "award_emoji"."awardable_type" = 'Issue' 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" = 442 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.6ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 443 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 443 AND "award_emoji"."awardable_type" = 'Issue' 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" = 443 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 444 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 444 AND "award_emoji"."awardable_type" = 'Issue' 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" = 444 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 445 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 445 AND "award_emoji"."awardable_type" = 'Issue' 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" = 445 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 446 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 446 AND "award_emoji"."awardable_type" = 'Issue' 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" = 446 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.5ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 447 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 447 AND "award_emoji"."awardable_type" = 'Issue' 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" = 447 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 448 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 448 AND "award_emoji"."awardable_type" = 'Issue' 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" = 448 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 449 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 449 AND "award_emoji"."awardable_type" = 'Issue' 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" = 449 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'
  Milestone Load (0.2ms)  SELECT "milestones".* FROM "milestones" WHERE "milestones"."id" = 37 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" = 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'
   (0.4ms)  SELECT COUNT(*) FROM "merge_requests_closing_issues" INNER JOIN "merge_requests" ON "merge_requests"."id" = "merge_requests_closing_issues"."merge_request_id" INNER JOIN project_features ON merge_requests.target_project_id = project_features.project_id WHERE "merge_requests_closing_issues"."issue_id" = 71 AND (project_features.merge_requests_access_level >= 20)
  ↳ app/models/merge_requests_closing_issues.rb:32:in `count_for_issue'
   (0.2ms)  SELECT COUNT(*) FROM "award_emoji" WHERE "award_emoji"."awardable_id" = 71 AND "award_emoji"."awardable_type" = 'Issue' 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" = 71 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."name" = 'thumbsdown'
  ↳ app/models/concerns/awardable.rb:89:in `downvotes'

Local performance test results:

(Puma max threads was set to 8)

Before (TTFB P90: 5977.69ms)
█ Results summary

* Environment:                Localhost
* Environment Version:        12.10.0-pre `6dd9d570014`
* Option:                     60s_20rps
* Date:                       2020-04-29
* Run Time:                   1m 1.44s (Start: 21:32:16 UTC, End: 21:33:18 UTC)
* GPT Version:                v1.2.6

NAME                 | RPS  | RPS RESULT       | TTFB AVG  | TTFB P90             | REQ STATUS      | RESULT          
---------------------|------|------------------|-----------|----------------------|-----------------|-----------------
api_v4_search_global | 20/s | 3.47/s (>4.80/s) | 5022.48ms | 5977.69ms (<25000ms) | 100.00% (>9.5%) | FAILED³
After (TTFB P90: 5530.69ms)
█ Results summary

* Environment:                Localhost
* Environment Version:        12.10.0-pre `6dd9d570014`
* Option:                     60s_20rps
* Date:                       2020-04-29
* Run Time:                   1m 1.48s (Start: 21:39:43 UTC, End: 21:40:44 UTC)
* GPT Version:                v1.2.6

NAME                 | RPS  | RPS RESULT      | TTFB AVG  | TTFB P90             | REQ STATUS      | RESULT          
---------------------|------|-----------------|-----------|----------------------|-----------------|-----------------
api_v4_search_global | 20/s | 3.9/s (>4.80/s) | 4516.18ms | 5530.69ms (<25000ms) | 100.00% (>9.5%) | FAILED³

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading