Module: ArJdbc::MySQL::ExplainSupport
- Included in:
- ActiveRecord::ConnectionAdapters::MysqlAdapter
- Defined in:
- lib/arjdbc/mysql/explain_support.rb
Instance Method Summary collapse
Instance Method Details
#explain(arel, binds = []) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/arjdbc/mysql/explain_support.rb', line 8 def explain(arel, binds = []) sql = "EXPLAIN #{to_sql(arel, binds)}" start = Time.now.to_f result = exec_query(sql, "EXPLAIN", binds) elapsed = Time.now.to_f - start ExplainPrettyPrinter.new.pp result, elapsed end |
#supports_explain? ⇒ Boolean
4 5 6 |
# File 'lib/arjdbc/mysql/explain_support.rb', line 4 def supports_explain? true end |