Fix pipelines chart query timeout
What does this MR do?
Improves performance of Pipelines charts by adding new index
Database explains
Migration output
== 20201106134139 AddPipelinesCreatedIndex: reverting =========================
-- transaction_open?()
-> 0.0000s
-- indexes(:ci_pipelines)
-> 0.0774s
-- remove_index(:ci_pipelines, {:algorithm=>:concurrently, :name=>:index_ci_pipelines_on_project_id_and_status_and_created_at})
-> 0.0348s
== 20201106134139 AddPipelinesCreatedIndex: reverted (0.1151s) ================
== 20201106134139 AddPipelinesCreatedIndex: migrating =========================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:ci_pipelines, [:project_id, :status, :created_at], {:name=>:index_ci_pipelines_on_project_id_and_status_and_created_at, :algorithm=>:concurrently})
-> 0.0648s
-- add_index(:ci_pipelines, [:project_id, :status, :created_at], {:name=>:index_ci_pipelines_on_project_id_and_status_and_created_at, :algorithm=>:concurrently})
-> 0.0454s
== 20201106134139 AddPipelinesCreatedIndex: migrated (0.1133s) ================
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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
Related to #31528 (closed)
Edited by Pavel Shutsin