instance method
explain
Ruby on Rails 7.0.10
Since v6.1.7.10Signature
explain(arel, binds = [])
No documentation comment.
Parameters
-
arelreq -
bindsopt = []
Source
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 33
def explain(arel, binds = [])
sql = "EXPLAIN #{to_sql(arel, binds)}"
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
result = exec_query(sql, "EXPLAIN", binds)
elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
MySQL::ExplainPrettyPrinter.new.pp(result, elapsed)
end
Defined in activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb line 33
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::MySQL::DatabaseStatements