Created
January 2, 2011 20:08
-
-
Save ch1ago/762774 to your computer and use it in GitHub Desktop.
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
this is my code | |
Post.select(:id, :user_id, :title).limit(30).includes(:user) | |
resuls in this sql | |
Post Load (9.0ms) SELECT "posts".id, "posts".user_id, "posts".title FROM "posts" LIMIT 30 | |
User Load (720.6ms) SELECT "users".* FROM "users" WHERE ("users"."id" IN (5,6,4,1,8,56,83,24,68,2,45,21)) | |
but querying for "users".* is taking too long | |
is there a way I can select less fields in the includes too? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment