instance method
explain
Ruby on Rails 4.2.9
Since v3.2.22.5Signature
explain()
Runs EXPLAIN on the query or queries triggered by this relation and returns the result as a string. The string is formatted imitating the ones printed by the database shell.
Note that this method actually runs the queries, since the results of some are needed by the next ones when eager loading is going on.
Please see further details in the Active Record Query Interface guide.
Source
# File activerecord/lib/active_record/relation.rb, line 235
def explain
#TODO: Fix for binds.
exec_explain(collecting_queries_for_explain { exec_queries })
end
Defined in activerecord/lib/active_record/relation.rb line 235
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation