method
explain
v7.0.0 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::MySQL::DatabaseStatements
explain(arel, binds = [])public
No documentation available.
# 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