Skip to content
Snippets Groups Projects

Improve performance of the global search for issuables

All threads resolved!
Compare and Show latest version
9 files
+ 115
77
Compare changes
  • Side-by-side
  • Inline
Files
9
@@ -29,6 +29,7 @@
# updated_after: datetime
# updated_before: datetime
# attempt_group_search_optimizations: boolean
# attempt_project_search_optimizations: boolean
#
class IssuableFinder
prepend FinderWithCrossProjectAccess
@@ -198,7 +199,7 @@ def projects
find_projects
end
@projects = projects.with_feature_available_for_user(klass, current_user).reorder(nil) # rubocop: disable CodeReuse/ActiveRecord
@projects = projects.with_feature_available_for_user(klass, current_user)
end
def find_group_projects
@@ -329,8 +330,7 @@ def use_cte_for_search?
next false if params[:sort].present? && !params[:sort].in?(klass.simple_sorts.keys)
attempt_group_search_optimizations? ||
attempt_project_search_optimizations? ||
attempt_global_search_optimizations?
attempt_project_search_optimizations?
end
end
@@ -349,11 +349,6 @@ def attempt_group_search_optimizations?
Feature.enabled?(:attempt_group_search_optimizations, default_enabled: true)
end
def attempt_global_search_optimizations?
params[:attempt_global_search_optimizations] &&
Feature.enabled?(:attempt_global_search_optimizations)
end
def attempt_project_search_optimizations?
params[:attempt_project_search_optimizations] &&
Feature.enabled?(:attempt_project_search_optimizations)
@@ -590,6 +585,6 @@ def current_user_related?
end
def min_access_level
current_user && ProjectFeature.required_minimum_access_level(klass)
ProjectFeature.required_minimum_access_level(klass)
end
end
Loading