什么是最好的方式来获取我的照片和一个朋友标记在他们的照片? [英] What is the best way to get list of photos with me and a friend tagged in them?

查看:86
本文介绍了什么是最好的方式来获取我的照片和一个朋友标记在他们的照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做这个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

这样可以正常工作,直到我使用2个用户ID,其中有数以千计的照片,其中数百个用两个标记的照片。

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

在这种情况下,FB返回一个 500错误:
错误加载脚本,错误代码1

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

我需要按照用户页面递增检索数据。获取所有用户的照片/标签,然后比较2个完整列表,这个应用程序是不能接受的。

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.

任何想法?

推荐答案

可能会像这样优化:

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)  

希望这有助于

这篇关于什么是最好的方式来获取我的照片和一个朋友标记在他们的照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆