title: grouping actions to offer suggestions
body: <p>I'm trying to offer artist suggestions based on our user's favorites.  </p>
  
  <p>Our table looks like:</p>
  
  <blockquote>
    <p>user_id | artist_id<br>
    1 | 4<br>
    2 | 4<br>
    1 | 3<br>
    4 | 4<br>
    6 | 2<br>
    6 | 3<br>
    4 | 3<br>
    2 | 3</p>
  </blockquote>
  
  <p>So if a random user is looking at artist_id 3, the code should query the database for other users who have favorited artist_id 3 and find the most common artist links between them</p>
  
  <p>In this case, artist_id 3 is favorited by users 1,3,4,6... and of those users, there is the common artist_id 4 that should be picked out (because it appears the most).  </p>
  
  <p>So how should I efficiently do this?  </p>
  
  <p>Do I do several queries?  First one to grab all user_ids who have artist_id 3, then I grab all favorites for those user_ids and group accordingly?</p>