title: Determine URLs from my site that where shared by current user friends
body: <p>I've got a PHP article site that allows logging in with Facebook and I need to show a list of "articles shared by your friends". Every article is shared as a link like mysite.com/articles/1. </p>
  
  <p>I've seen <a href="http://facebook.stackoverflow.com/questions/7048339/facebook-api-all-links-shared-by-all-friends">this</a> question but as the url field in the link table is not indexed, I can't use "WHERE url LIKE '%mysite.com%'" and therefore the retrieved list of links will be too big to filter through a PHP loop (100 users sharing 100 each will show 10000 urls to filter on every page load).</p>
  
  <p>I'm currently using this FQL query: "SELECT url FROM link WHERE owner IN (SELECT uid1 FROM friend WHERE uid2 = me()) LIMIT 1000;" and recursively executing it if not enough records remain after the filter. Also, for some reason this query is taking much longer than others.</p>
  
  <p>Any ideas?</p>