ANN assert_efficient_sql

P

Phlip

To ensure your test cases 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.

The goal is test cases that resist database pessimization, even as you change
your data relations, to add new features. If you run your tests after
every few changes, you can easily detect which change broke your database's
indices and relations.

Blog:

http://www.oreillynet.com/ruby/blog/2008/01/assert_efficient_sql.html

RDocs:

http://efficient-sql.rubyforge.org/

A critique:

http://enfranchisedmind.com/blog/2008/01/14/assert_efficient_sql/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,276
Messages
2,571,384
Members
48,073
Latest member
ImogenePal

Latest Threads

Top