class ActiveRecord::ConnectionAdapters::MySQL::Table
Active Record MySQL
Adapter Table
Inherits From
-
class
ActiveRecord::
ConnectionAdapters:: Table -
module
ActiveRecord::
ConnectionAdapters:: MySQL:: ColumnMethods
Public instance methods
Disables an index not to be used by query optimizers.
t.disable_index(:email)
Note: only supported by MySQL
version 8.0.0 and greater, and MariaDB version 10.6.0 and greater.
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 140
def disable_index(index_name)
@base.disable_index(name, index_name)
end
Enables an index to be used by query optimizers.
t.enable_index(:email)
Note: only supported by MySQL
version 8.0.0 and greater, and MariaDB version 10.6.0 and greater.
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 129
def enable_index(index_name)
@base.enable_index(name, index_name)
end