We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82439ba commit a70a1dbCopy full SHA for a70a1db
lib/tasks/benchmark.rake
@@ -25,4 +25,9 @@ end
25
task :benchmark => :environment do
26
benchmark_query "5 latest posts", Post.latest.limit(5)
27
benchmark_query "5 latest published posts", Post.published.latest.limit(5)
28
+
29
+ user = User.find(rand(1000) + 1)
30
+ benchmark_query "Posts for a user", user.posts
31
+ benchmark_query "Published posts for a user", user.posts.published
32
+ benchmark_query "5 latest published posts for a user", user.posts.published.latest.limit(5)
33
end
0 commit comments