Remove mysql-specific reference

pull/10698/head
Oliver Günther 2 years ago
parent 819f3d83ba
commit ddce9725cb
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 15
      app/controllers/work_packages/auto_completes_controller.rb

@ -81,19 +81,6 @@ class WorkPackages::AutoCompletesController < ::ApplicationController
end
def work_package_scope
scope = WorkPackage.all
# The filter on subject in combination with the ORDER BY on id
# seems to trip MySql's usage of indexes on the order statement
# I haven't seen similar problems on postgresql but there might be as the
# data at hand was not very large.
#
# For MySql we are therefore helping the DB optimizer to use the correct index
if ActiveRecord::Base.connection_config[:adapter] == 'mysql2'
scope = scope.from("#{WorkPackage.table_name} USE INDEX(PRIMARY)")
end
scope
WorkPackage.all
end
end

Loading…
Cancel
Save