What is the best way to get list of photos with me

2019-04-12 01:21发布

I'm doing this fql:

SELECT object_id, pid, src_big, src_big_height, src_big_width, src, src_height, src_width 
FROM photo 
WHERE pid IN (SELECT pid FROM photo_tag WHERE subject= [me_uid]) AND pid IN (SELECT pid FROM photo_tag WHERE subject= [friend_uid] ) limit 0, 20

This works fine until I use 2 users ids who have thousands of photos with hundreds of them tagged with both uids.

In this scenario, FB returns a 500 error: "Error loading script", error code 1

I need to incrementally retrieve data as a user pages down. Getting All photos/tags for both users and then comparing the 2 full lists is not acceptable for this app.

Any thoughts?

1条回答
淡お忘
2楼-- · 2019-04-12 02:13

Maybe optimize it like so:

SELECT object_id
  FROM photo 
 WHERE pid IN (SELECT pid 
                 FROM photo_tag 
                WHERE subject = [me_uid] AND pid IN (SELECT pid 
                                                       FROM photo_tag 
                                                      WHERE subject [friend_uid]) LIMIT 0, 20)  

hope this helps

查看更多
登录 后发表回答