instance method
explain
Ruby on Rails edge
Since v6.1.7.10Signature
explain(arel_or_sql, binds = [], options = [])
No documentation comment.
Parameters
-
arel_or_sqlreq -
bindsopt = [] -
optionsopt = []
Source
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 27
def explain(arel_or_sql, binds = [], options = [])
sql, binds = to_sql_and_binds(arel_or_sql, binds)
sql = build_explain_clause(options) + " " + sql
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
result = select_all(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