instance method
explain
Ruby on Rails 3.2.22.5
Since v3.2.22.5 Last seen in v4.2.9Signature
explain(arel, binds = [])
DATABASE STATEMENTS ======================================
Parameters
-
arelreq -
bindsopt = []
Source
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 97
def explain(arel, binds = [])
sql = "EXPLAIN #{to_sql(arel, binds.dup)}"
start = Time.now
result = exec_query(sql, 'EXPLAIN', binds)
elapsed = Time.now - start
ExplainPrettyPrinter.new.pp(result, elapsed)
end
Defined in activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb line 97
· View on GitHub
· Improve this page
· Find usages on GitHub