Module: ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements

Defined in:
lib/sql_optimizer/analyze.rb

Instance Method Summary collapse

Instance Method Details

#analyze(arel, binds = []) ⇒ Object



5
6
7
8
# File 'lib/sql_optimizer/analyze.rb', line 5

def analyze(arel, binds = [])
  sql = "EXPLAIN ANALYZE #{to_sql(arel, binds)}"
  PostgreSQL::ExplainPrettyPrinter.new.pp(exec_query(sql, 'EXPLAIN ANALYZE', binds))
end