获取我和其中标记的朋友的照片列表的最佳方式是什么?

发布于 2024-12-06 02:48:07 字数 508 浏览 1 评论 0原文

我正在做这个 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,他们有数千张照片,其中数百张照片都用两个 uid 标记。

在这种情况下,FB 返回 500 错误: “加载脚本时出错”,错误代码 1

我需要在用户向下翻页时增量检索数据。对于此应用程序来说,获取两个用户的所有照片/标签然后比较 2 个完整列表是不可接受的。

有什么想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

平安喜乐 2024-12-13 02:48:07

也许像这样优化它:

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)  

希望这有帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文