Commit 039c93ab authored by Adam Hegyi's avatar Adam Hegyi

Merge branch '208885-optimize-ci_pipeline-counters-related-to-the-ci-pipeline' into 'master'

Optimize ci_pipeline counters

See merge request gitlab-org/gitlab!26774
parents b95ad734 00997da2
---
title: Optimize ci_pipelines counters in usage data
merge_request: 26774
author:
type: performance
# frozen_string_literal: true
class AddIndexOnUserIdAndCreatedAtToCiPipelines < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :ci_pipelines, [:user_id, :created_at]
remove_concurrent_index :ci_pipelines, [:user_id]
end
def down
add_concurrent_index :ci_pipelines, [:user_id]
remove_concurrent_index :ci_pipelines, [:user_id, :created_at]
end
end
......@@ -873,7 +873,7 @@ ActiveRecord::Schema.define(version: 2020_03_09_195710) do
t.index ["project_id", "status", "config_source"], name: "index_ci_pipelines_on_project_id_and_status_and_config_source"
t.index ["project_id", "status", "updated_at"], name: "index_ci_pipelines_on_project_id_and_status_and_updated_at"
t.index ["status"], name: "index_ci_pipelines_on_status"
t.index ["user_id"], name: "index_ci_pipelines_on_user_id"
t.index ["user_id", "created_at"], name: "index_ci_pipelines_on_user_id_and_created_at"
end
create_table "ci_pipelines_config", primary_key: "pipeline_id", force: :cascade do |t|
......
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