Created
March 2, 2015 20:19
-
-
Save razorcd/987302fa0e9681df7c72 to your computer and use it in GitHub Desktop.
Banchmark SQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bm = ->(counter=1) { | |
Benchmark.measure do | |
counter.times do |i| | |
Sponsorship.joins(:sponsor, :orphan). | |
where("sponsor_id = ?",1). | |
select("orphans.name as orphans_name, orphans.date_of_birth as orphans_date_of_birth, orphans.gender as orphans_gender"). | |
to_a | |
# puts i | |
end | |
end | |
} | |
bm.call(1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment