MsSQL-internal:
To ensure your test cases (under ActiveRecord) call efficient MySQL…
def test_my_case
assert_efficient_sql do
# just wrap them in this block!
end
end
The assertion intercepts and copies out your MySQL SELECT statements, then calls
EXPLAIN on each one, and inspects the results for common problems.
This article is a reference for this assertion’s options. The techniques should
be ported to any database with an EXPLAIN
http://www.oreillynet.com/ruby/blog/2008/01/assert_efficient_sql.html
--
Phlip