> I'm a bit worried about the performance side of that request since there > can be a huge number of messages and users. Of course user_id should be > indexed in that table but I'm still worried.
this is still teh fastest way to do it since you are telling the db fetch all of these ids at once. Then again, > Don't worry about it until it's a problem is kinda the best advice in the matter if you add. "or untill you are finished, have done profiling and are bored of tv" On Mar 16, 9:31 pm, comopasta Gr <[email protected]> wrote: > "Wolas!" wrote: > > Message.all(:conditions => {:user_id => current_user.friends}) > > > assuming the table messages has a column user_id. > > > On Mar 15, 10:27 pm, comopasta Gr <[email protected]> > > Thanks Wolas, actually that worked fine :-) > I'm a bit worried about the performance side of that request since there > can be a huge number of messages and users. Of course user_id should be > indexed in that table but I'm still worried. > > Any comments on the performance from anyone? > > Thanks. > > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

