diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-27 11:51:45 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-27 11:51:45 +0000 |
commit | a39d65b8f6e1a23c00cb1f076e9893f9642ad3b1 (patch) | |
tree | 2f6a17524c24671d31966a1c7dda34a6a9d149a1 | |
parent | ac4ac5f2e20136dc378bdba15f40d0a3d2dcc69f (diff) | |
parent | 1286151578af69e88d267d0dc3294ef1ed0062c2 (diff) | |
download | gitlab-ce-a39d65b8f6e1a23c00cb1f076e9893f9642ad3b1.tar.gz |
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
-rw-r--r-- | app/models/event.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/27267-events-project-query-performance-regression.yml | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index 4b8eac9accf..d7ca8e3c599 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -36,7 +36,7 @@ class Event < ActiveRecord::Base scope :code_push, -> { where(action: PUSHED) } scope :in_projects, ->(projects) do - where(project_id: projects).recent + where(project_id: projects.pluck(:id)).recent end scope :with_associations, -> { includes(:author, :project, project: :namespace).preload(:target) } diff --git a/changelogs/unreleased/27267-events-project-query-performance-regression.yml b/changelogs/unreleased/27267-events-project-query-performance-regression.yml new file mode 100644 index 00000000000..a1697b57eac --- /dev/null +++ b/changelogs/unreleased/27267-events-project-query-performance-regression.yml @@ -0,0 +1,4 @@ +--- +title: 'Add performance query regression fix for !9088 affecting #27267' +merge_request: +author: |