Facebook 查询速度非常慢
您好,我正在使用此查询来获取用户的下一个 Facebook 事件:
FB.Data.query("select eid,name,start_time,location,venue,
pic_small,pic_big,description
from event WHERE eid IN (SELECT eid FROM event_member WHERE uid={0})
AND start_time >= " + from + " ORDER BY start_time LIMIT 10", uid);
但是对于具有许多事件的用户来说,这非常慢。 我该怎么做才能加快速度?
谢谢
Hi i'm using this query for get next facebook events of a user:
FB.Data.query("select eid,name,start_time,location,venue,
pic_small,pic_big,description
from event WHERE eid IN (SELECT eid FROM event_member WHERE uid={0})
AND start_time >= " + from + " ORDER BY start_time LIMIT 10", uid);
But for users with many events this is very slow.
How can i do to speed it?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我没有使用过 Facebook API,但从查询中我可以看出,它对他们的系统的负担比“直接数据抓取”要多一些,所以他们可能会对这种查询强加有意的等待时间..为什么不只是做一个更基本的,然后在你的脚本中进行处理?例如,我不知道您正在使用什么语言,但您可以轻松地在自己这边进行排序(按开始时间排序)...也许只是稍微尝试一下并施加更少的限制,看看它是否更快,至少这样你可以更好地了解你正在处理的内容,以及它们是否强加等待等...
此外,你从什么类型的设置访问它?是云服务器、本地机、共享主机吗?共享主机有时会在限制速度方面做出奇怪的事情,因此如果您可以从不同的设置中尝试它,也可能会有所帮助。
Well, I haven't used the Facebook API, but from the query I can tell its taxing their system a bit more than a "straight data grab" so they might impose an intentional wait time on this sort of query.. why not just do a more basic one and then do the processing in your script? For example, I don't know what langauge you are using, but you could easily do the ordering on your own side (order by start time)... maybe just play around with it a bit and impose less constraints and see if its faster, at least this way you have a better idea of what you're working with as far as if they impose waits, etc...
Also, what type of set-up are you accessing this from? Is it a cloud server, local machine, shared hosting? Shared hosts sometimes do weird things in imposing limitations on speeds so if you can try it from a different setup that may help too.