Methods
Instance Public methods
build_explain_clause(options = [])
📝 Source code
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 36
def build_explain_clause(options = [])
return "EXPLAIN" if options.empty?
explain_clause = "EXPLAIN #{options.join(" ").upcase}"
if analyze_without_explain? && explain_clause.include?("ANALYZE")
explain_clause.sub("EXPLAIN ", "")
else
explain_clause
end
end
🔎 See on GitHub
explain(arel, binds = [], options = [])
📝 Source code
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 27
def explain(arel, binds = [], options = [])
sql = build_explain_clause(options) + " " + to_sql(arel, binds)
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
result = internal_exec_query(sql, "EXPLAIN", binds)
elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
MySQL::ExplainPrettyPrinter.new.pp(result, elapsed)
end
🔎 See on GitHub
high_precision_current_timestamp()
📝 Source code
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 23
def high_precision_current_timestamp
HIGH_PRECISION_CURRENT_TIMESTAMP
end
🔎 See on GitHub