diff --git a/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb b/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb
new file mode 100644
index 0000000000000000000000000000000000000000..791c5b60e548bd17b87428f610ae3d08d065b4ea
--- /dev/null
+++ b/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb
@@ -0,0 +1,17 @@
+# 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
diff --git a/db/schema_migrations/20210818034001 b/db/schema_migrations/20210818034001
new file mode 100644
index 0000000000000000000000000000000000000000..e20a891b5f139b599cae8f6cabe1ae9294296001
--- /dev/null
+++ b/db/schema_migrations/20210818034001
@@ -0,0 +1 @@
+ebf0c2a7b0563dafa562136a0758baf631db92c0ce33f7200da24092f1eb2930
\ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 413c90d060ccc6aa0e0a26f4292bb3334a6da4ad..a8f9f316a5079dc6d0d197548e35e483123dd6dd 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -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);