instance method
explain
Ruby on Rails 6.1.7.10
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 238
def explain
exec_explain(collecting_queries_for_explain { exec_queries })
end
Defined in activerecord/lib/active_record/relation.rb line 238
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation