diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 5cdc22fd873f6739d5ccad07f83389f0a6599f2a..02e800eb86fb3b714212ef9e022e5c122dec6edb 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -103,8 +103,8 @@ def execute
     items = filter_negated_items(items)
 
     # This has to be last as we use a CTE as an optimization fence
-    # for counts by passing the force_cte param and enabling the
-    # attempt_group_search_optimizations feature flag
+    # for counts by passing the force_cte param and passing the
+    # attempt_group_search_optimizations param
     # https://www.postgresql.org/docs/current/static/queries-with.html
     items = by_search(items)
 
@@ -229,8 +229,7 @@ def init_collection
   end
 
   def attempt_group_search_optimizations?
-    params[:attempt_group_search_optimizations] &&
-      Feature.enabled?(:attempt_group_search_optimizations, default_enabled: true)
+    params[:attempt_group_search_optimizations]
   end
 
   def attempt_project_search_optimizations?
diff --git a/changelogs/unreleased/214382-remove-feature-flag.yml b/changelogs/unreleased/214382-remove-feature-flag.yml
new file mode 100644
index 0000000000000000000000000000000000000000..38695c5bf37246938536346ab2ede6f0fcac5f3b
--- /dev/null
+++ b/changelogs/unreleased/214382-remove-feature-flag.yml
@@ -0,0 +1,5 @@
+---
+title: Remove attempt_group_search_optimizations feature flag
+merge_request: 40881
+author: gaga5lala
+type: other
diff --git a/ee/app/finders/epics_finder.rb b/ee/app/finders/epics_finder.rb
index b11421e4ab3ed35bdd2bfa05d404a12c3499aec3..e18729e45c4429406772e33c0daf254b09cfed7d 100644
--- a/ee/app/finders/epics_finder.rb
+++ b/ee/app/finders/epics_finder.rb
@@ -65,8 +65,7 @@ def execute(skip_visibility_check: false)
     items = filter_negated_items(items)
 
     # This has to be last as we use a CTE as an optimization fence
-    # for counts by passing the force_cte param and enabling the
-    # attempt_group_search_optimizations feature flag
+    # for counts by passing the force_cte param
     # https://www.postgresql.org/docs/current/static/queries-with.html
     items = by_search(items)
 
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index 78de89de796e44722f37f1ff920b9464cd57855d..35d8c0b7c6d3d5795bb60de7495ac09fb430df3a 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -422,10 +422,6 @@
     end
 
     context 'searching' do
-      before do
-        stub_feature_flags(attempt_group_search_optimizations: true)
-      end
-
       it 'works with popularity sort' do
         get :issues, params: { id: group.to_param, search: 'foo', sort: 'popularity' }
 
diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb
index fb7d4e808fe2cb6bb4349d5add7acd7de98ceb22..9cb4f8c9fc168e07c3f159ef0ca0455683e89fe9 100644
--- a/spec/finders/issues_finder_spec.rb
+++ b/spec/finders/issues_finder_spec.rb
@@ -949,10 +949,6 @@
   describe '#use_cte_for_search?' do
     let(:finder) { described_class.new(nil, params) }
 
-    before do
-      stub_feature_flags(attempt_group_search_optimizations: true)
-    end
-
     context 'when there is no search param' do
       let(:params) { { attempt_group_search_optimizations: true } }
 
@@ -969,18 +965,6 @@
       end
     end
 
-    context 'when the attempt_group_search_optimizations flag is disabled' do
-      let(:params) { { search: 'foo', attempt_group_search_optimizations: true } }
-
-      before do
-        stub_feature_flags(attempt_group_search_optimizations: false)
-      end
-
-      it 'returns false' do
-        expect(finder.use_cte_for_search?).to be_falsey
-      end
-    end
-
     context 'when attempt_group_search_optimizations is unset and attempt_project_search_optimizations is set' do
       let(:params) { { search: 'foo', attempt_project_search_optimizations: true } }