instance method
explain
Ruby on Rails 7.1.6
Since v6.1.7.10Signature
explain(arel, binds = [], options = [])
No documentation comment.
Parameters
-
arelreq -
bindsopt = [] -
optionsopt = []
Source
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 27
def explain(arel, binds = [], options = [])
sql = build_explain_clause(options) + " " + to_sql(arel, binds)
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
result = internal_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 27
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::MySQL::DatabaseStatements