Commit 2c5c48e6 authored by Yannis Roussos's avatar Yannis Roussos

Merge branch 'add_index_for_sha_to_deployments' into 'master'

Add index for sha to deployments

See merge request gitlab-org/gitlab!43836
parents 0acf5944 75b7e982
---
title: Add index for project_id and sha to deployments table
merge_request: 43836
author:
type: performance
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddIndexOnProjectIdAndShaToDeployments < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_deployments_on_project_id_sha'
disable_ddl_transaction!
def up
add_concurrent_index :deployments, [:project_id, :sha], name: INDEX_NAME
end
def down
remove_concurrent_index_by_name(:deployments, INDEX_NAME)
end
end
45530bb3090d9e8df3a79f42a06b042e0c40f6e185078c6d79d7ec334175c7d5
\ No newline at end of file
......@@ -20007,6 +20007,8 @@ CREATE INDEX index_deployments_on_project_id_and_status_and_created_at ON deploy
CREATE INDEX index_deployments_on_project_id_and_updated_at_and_id ON deployments USING btree (project_id, updated_at DESC, id DESC);
CREATE INDEX index_deployments_on_project_id_sha ON deployments USING btree (project_id, sha);
CREATE INDEX index_deployments_on_user_id_and_status_and_created_at ON deployments USING btree (user_id, status, created_at);
CREATE INDEX index_description_versions_on_epic_id ON description_versions USING btree (epic_id) WHERE (epic_id IS NOT NULL);
......
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