diff --git a/db/post_migrate/20220617073407_add_index_for_open_issues_count.rb b/db/post_migrate/20220617073407_add_index_for_open_issues_count.rb
new file mode 100644
index 0000000000000000000000000000000000000000..5c11e7b1b9a2184ebb7ec204549758c3e96c2bfe
--- /dev/null
+++ b/db/post_migrate/20220617073407_add_index_for_open_issues_count.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexForOpenIssuesCount < Gitlab::Database::Migration[2.0]
+  disable_ddl_transaction!
+
+  INDEX_NAME = 'idx_open_issues_on_project_id_and_confidential'
+
+  def up
+    add_concurrent_index :issues, [:project_id, :confidential], where: 'state_id = 1', name: INDEX_NAME
+  end
+
+  def down
+    remove_concurrent_index_by_name :issues, INDEX_NAME
+  end
+end
diff --git a/db/schema_migrations/20220617073407 b/db/schema_migrations/20220617073407
new file mode 100644
index 0000000000000000000000000000000000000000..4914915f1e61e17c42ee503da78bebf248b11e02
--- /dev/null
+++ b/db/schema_migrations/20220617073407
@@ -0,0 +1 @@
+aff0fb4359747e74fd8275774f1644f0d0acd9f22469c88874cfcd0c7d44752f
\ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 7f3d91aa782bf5c98aae7677797443cfefadeda5..13e48ceffa62ebe7dbd5a8a8460c2400346b658c 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -26875,6 +26875,8 @@ CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_external_url ON ext
 
 CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_name ON external_status_checks USING btree (project_id, name);
 
+CREATE INDEX idx_open_issues_on_project_id_and_confidential ON issues USING btree (project_id, confidential) WHERE (state_id = 1);
+
 CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON packages_debian_group_component_files USING btree (architecture_id);
 
 CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON packages_debian_project_component_files USING btree (architecture_id);