title: Rails 4 View Rendering Very Slow
body: <p>I've been developing my first Rails App and it has suddenly become very slow. I am not sure what has caused it. I had already added paperclip for management of images and just switched to using Dropbox (as opposed to local) storage just before it started going slow but I also made some unrelated view changes as well.</p>
  
  <p>Now, I am relatively new to Rails and MVC Frameworks in general. So I do suspect it is something I am doing wrong due to ignorance and lack of experience. It's just that the same ignorance and lack of experience makes it difficult to diagnose the problem.</p>
  
  <p>So, here is the output when running in development with "rails server" (though production on Heroku wasn't much faster).</p>
  
  <pre><code>    Started GET "/games/index" for 217.156.133.130 at 2014-05-16 09:31:10 -0400
      Started GET "/games/index" for 217.156.133.130 at 2014-05-16 09:31:10 -0400
      Processing by GamesController#index as HTML
      Processing by GamesController#index as HTML
        Game Load (1.3ms)  SELECT "games".* FROM "games" ORDER BY name ASC
        Game Load (1.3ms)  SELECT "games".* FROM "games" ORDER BY name ASC
     (0.8ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 9]]
     (0.8ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 9]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 9]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 9]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 5]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 5]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 5]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 5]]
     (1.0ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 7]]
     (1.0ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 7]]
    User Load (0.6ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 7]]
    User Load (0.6ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 7]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 12]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 12]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 12]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 12]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 2]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 2]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 2]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 2]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 10]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 10]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 10]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 10]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 23]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 23]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 23]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 23]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 18]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 18]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 18]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 18]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 3]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 3]]
    User Load (0.7ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 3]]
    User Load (0.7ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 3]]
     (0.8ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 13]]
     (0.8ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 13]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 13]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 13]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 24]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 24]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 24]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 24]]
     (1.2ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 17]]
     (1.2ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 17]]
    User Load (0.8ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 17]]
    User Load (0.8ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 17]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 4]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 4]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 4]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 4]]
     (1.0ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 8]]
     (1.0ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 8]]
    User Load (0.6ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 8]]
    User Load (0.6ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 8]]
     (0.8ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 19]]
     (0.8ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 19]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 19]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 19]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 15]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 15]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 15]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 15]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 16]]
     (0.6ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 16]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 16]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 16]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 20]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 20]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 20]]
    User Load (0.4ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 20]]
     (1.0ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 21]]
     (1.0ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 21]]
    User Load (0.7ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 21]]
    User Load (0.7ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 21]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 22]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 22]]
    User Load (0.6ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 22]]
    User Load (0.6ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 22]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 1]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 1]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 1]]
    User Load (0.5ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 1]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 6]]
     (0.9ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 6]]
    User Load (0.7ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 6]]
    User Load (0.7ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 6]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 11]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 11]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 11]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 11]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 14]]
     (0.7ms)  SELECT COUNT(*) FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 14]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 14]]
    User Load (0.3ms)  SELECT "users".* FROM "users" INNER JOIN "user_games" ON "users"."id" = "user_games"."user_id" WHERE "user_games"."game_id" = $1  [["game_id", 14]]
    Rendered games/index.html.erb within layouts/application (77221.9ms)
    Rendered games/index.html.erb within layouts/application (77221.9ms)
  Completed 200 OK in 77227ms (Views: 77194.1ms | ActiveRecord: 31.4ms)
  Completed 200 OK in 77227ms (Views: 77194.1ms | ActiveRecord: 31.4ms)
  </code></pre>
  
  <p>As you can see the View is taking nearly a minute and 20 seconds to render, and database access isn't really an issue. Here is the view that this is rendering.</p>
  
  <pre><code>    &lt;h1&gt;All Games&lt;/h1&gt;
  
  &lt;%= link_to "Add new", games_new_path %&gt;
  
  &lt;% @games.each do |game| %&gt;
    &lt;div class="game"&gt;
      &lt;div class="game_image"&gt;
        &lt;% if game.image.exists? %&gt;
          &lt;%= image_tag game.image.url(:thumb) %&gt;
        &lt;% end %&gt;
      &lt;/div&gt;
      &lt;div class="game_info"&gt;
        &lt;h2&gt;&lt;%= link_to game.name, game %&gt;&lt;/h2&gt;&lt;%= link_to "Edit", edit_game_path(game) %&gt;&lt;br /&gt;
        &lt;% if game.free %&gt;
          This game is free.&lt;br /&gt;
          &lt;% if game.notes != "" %&gt;
            N.B. &lt;%= game.notes %&gt;
          &lt;% end %&gt;
        &lt;% end %&gt;
        &lt;%= game.users.size %&gt; Players&lt;br /&gt;
        &lt;div class="user_list"&gt;
        &lt;% game.users.each do |user| %&gt;
          &lt;div class="user_thumb"&gt;
            &lt;% if user.avatar.exists? %&gt;
              &lt;%= link_to image_tag(user.avatar.url(:pinky)), user %&gt;
            &lt;% else %&gt;
              &lt;div class="alt_link"&gt;
                &lt;%= link_to user.name, user %&gt;
              &lt;/div&gt;
            &lt;% end %&gt;
          &lt;/div&gt;
        &lt;% end %&gt;
      &lt;/div&gt;
      &lt;div class="clear_div"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>My knowledge from just general programming suggests to me that the most costly part of this should be the fact that for each game I am looping through all of its users (users and games have a many-to-many relationship). However, each table in the database has only tens of records... there is hardly any data to process, so I don't believe it should really be quite <em>this</em> slow.</p>
  
  <p>As a Rails novice, can anyone recommend to me some steps I can take to try and see what is causing this? I have googled around and I see that a lot of people have this problem but apparently there are many reasons it can happen because nothing I have found has solved my particular problem.</p>
  
  <p>EDIT: After adding Eager Loading, Active Record is much quicker but View rendering is still extremely slow.</p>
  
  <pre><code>Started GET "/games/index" for 217.156.133.130 at 2014-05-16 10:07:07 -0400
  Started GET "/games/index" for 217.156.133.130 at 2014-05-16 10:07:07 -0400
  Processing by GamesController#index as HTML
  Processing by GamesController#index as HTML
    Game Load (1.1ms)  SELECT "games".* FROM "games" ORDER BY name ASC
    Game Load (1.1ms)  SELECT "games".* FROM "games" ORDER BY name ASC
    UserGame Load (0.8ms)  SELECT "user_games".* FROM "user_games" WHERE "user_games"."game_id" IN (9, 5, 7, 12, 2, 10, 23, 18, 3, 13, 24, 17, 4, 8, 19, 15, 16, 20, 21, 22, 1, 6, 11, 14)
    UserGame Load (0.8ms)  SELECT "user_games".* FROM "user_games" WHERE "user_games"."game_id" IN (9, 5, 7, 12, 2, 10, 23, 18, 3, 13, 24, 17, 4, 8, 19, 15, 16, 20, 21, 22, 1, 6, 11, 14)
    User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 6, 4, 1, 9, 8, 11)
    User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN (5, 6, 4, 1, 9, 8, 11)
    Rendered games/index.html.erb within layouts/application (79191.5ms)
    Rendered games/index.html.erb within layouts/application (79191.5ms)
  Completed 200 OK in 79196ms (Views: 79191.6ms | ActiveRecord: 2.5ms)
  Completed 200 OK in 79196ms (Views: 79191.6ms | ActiveRecord: 2.5ms)
  </code></pre>