BigW Consortium Gitlab

Commit a39d65b8 by Sean McGivern

Merge branch '27267-events-project-query-performance-regression' into 'master'

Query performance regression fix affecting "Dashboard::ProjectsController#index.atom" Closes #27267 See merge request !9526
parents ac4ac5f2 12861515
...@@ -36,7 +36,7 @@ class Event < ActiveRecord::Base ...@@ -36,7 +36,7 @@ class Event < ActiveRecord::Base
scope :code_push, -> { where(action: PUSHED) } scope :code_push, -> { where(action: PUSHED) }
scope :in_projects, ->(projects) do scope :in_projects, ->(projects) do
where(project_id: projects).recent where(project_id: projects.pluck(:id)).recent
end end
scope :with_associations, -> { includes(:author, :project, project: :namespace).preload(:target) } scope :with_associations, -> { includes(:author, :project, project: :namespace).preload(:target) }
......
---
title: 'Add performance query regression fix for !9088 affecting #27267'
merge_request:
author:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment