Commit 30e2fe11 authored by Alper Akgun's avatar Alper Akgun

Merge branch '268248-remove-index-service-for-usage-data' into 'master'

Remove unnecessary index on services for usage data

See merge request gitlab-org/gitlab!45655
parents a56335b8 88fe0bcb
---
title: Remove unnecessary index on services for usage data
merge_request: 45655
author:
type: other
# frozen_string_literal: true
class RemoveIndexServiceForUsageData < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_services_on_type_id_when_active_not_instance_not_template'
disable_ddl_transaction!
def up
remove_concurrent_index_by_name :services, INDEX_NAME
end
def down
add_concurrent_index :services, [:type, :id], where: 'active = TRUE AND instance = FALSE AND template = FALSE', name: INDEX_NAME
end
end
ba16ad5a51494f436dc47ffb924f94ce7795bfd3b9061ca58d1c8dda238245e9
\ No newline at end of file
......@@ -21570,8 +21570,6 @@ CREATE UNIQUE INDEX index_services_on_type_and_template_partial ON services USIN
CREATE INDEX index_services_on_type_id_when_active_and_project_id_not_null ON services USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL));
CREATE INDEX index_services_on_type_id_when_active_not_instance_not_template ON services USING btree (type, id) WHERE ((active = true) AND (instance = false) AND (template = false));
CREATE UNIQUE INDEX index_services_on_unique_group_id_and_type ON services USING btree (group_id, type);
CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name);
......
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