diff options
-rw-r--r-- | app/models/ci/pipeline.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/43134-reduce-queries-pipelines-controller-show.yml | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 2abe90dd181..a72a815bfe8 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -13,7 +13,7 @@ module Ci belongs_to :pipeline_schedule, class_name: 'Ci::PipelineSchedule' has_many :stages - has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id + has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id, inverse_of: :pipeline has_many :builds, foreign_key: :commit_id has_many :trigger_requests, dependent: :destroy, foreign_key: :commit_id # rubocop:disable Cop/ActiveRecordDependent has_many :variables, class_name: 'Ci::PipelineVariable' diff --git a/changelogs/unreleased/43134-reduce-queries-pipelines-controller-show.yml b/changelogs/unreleased/43134-reduce-queries-pipelines-controller-show.yml new file mode 100644 index 00000000000..c1e9614b676 --- /dev/null +++ b/changelogs/unreleased/43134-reduce-queries-pipelines-controller-show.yml @@ -0,0 +1,5 @@ +--- +title: Improve performance of pipeline page by reducing DB queries +merge_request: 17168 +author: +type: performance |