Commit 6f42db35 authored by Krasimir Angelov's avatar Krasimir Angelov

Add index on historical_data (recored_at) to improve queries

https://gitlab.com/gitlab-org/gitlab/-/issues/334761

Changelog: other
parent 809146f6
# frozen_string_literal: true
class IndexHistoricalDataOnRecordedAt < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
INDEX_NAME = 'index_historical_data_on_recorded_at'
disable_ddl_transaction!
def up
add_concurrent_index :historical_data, :recorded_at, name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :historical_data, INDEX_NAME
end
end
ebf0c2a7b0563dafa562136a0758baf631db92c0ce33f7200da24092f1eb2930
\ No newline at end of file
......@@ -24097,6 +24097,8 @@ CREATE UNIQUE INDEX index_group_wiki_repositories_on_disk_path ON group_wiki_rep
CREATE INDEX index_group_wiki_repositories_on_shard_id ON group_wiki_repositories USING btree (shard_id);
CREATE INDEX index_historical_data_on_recorded_at ON historical_data USING btree (recorded_at);
CREATE UNIQUE INDEX index_http_integrations_on_active_and_project_and_endpoint ON alert_management_http_integrations USING btree (active, project_id, endpoint_identifier) WHERE active;
CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (saml_provider_id) WHERE (saml_provider_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