diff --git a/db/post_migrate/20221216232658_index_members_on_member_namespace_id_compound.rb b/db/post_migrate/20221216232658_index_members_on_member_namespace_id_compound.rb
new file mode 100644
index 0000000000000000000000000000000000000000..56adad1e4a5d7d38c7705de7bc0f4fd9546eea68
--- /dev/null
+++ b/db/post_migrate/20221216232658_index_members_on_member_namespace_id_compound.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class IndexMembersOnMemberNamespaceIdCompound < Gitlab::Database::Migration[2.1]
+  INDEX_NAME = 'index_members_on_member_namespace_id_compound'
+
+  disable_ddl_transaction!
+
+  def up
+    prepare_async_index(
+      :members,
+      [:member_namespace_id, :type, :requested_at, :id],
+      name: INDEX_NAME
+    )
+  end
+
+  def down
+    remove_concurrent_index_by_name :members, INDEX_NAME
+  end
+end
diff --git a/db/schema_migrations/20221216232658 b/db/schema_migrations/20221216232658
new file mode 100644
index 0000000000000000000000000000000000000000..18a3e5e18f2e7a307508a4437b3cc47f4e46b7dc
--- /dev/null
+++ b/db/schema_migrations/20221216232658
@@ -0,0 +1 @@
+8e9bb800a2eab9f5d5a3b4f3835b6c4f21ec861a5808a13bef8d496773a7799c
\ No newline at end of file