1

我正在开发 Facebook 中的自定义事件应用程序,并遇到了响应似乎很慢的问题。缓慢主要与尝试搜索与事件地理位置相关联的页面有关。即“城市,国家”。一旦这样的 URL 将是:

http://www.facebook.com/pages/Buenos-Aires-Argentina/106423786059675

我已经确定可以使用以下 FQL 查询获取此类页面的页面 URL:

SELECT page_id, page_url FROM page WHERE name = "Buenos Aires, Argentina" AND type = "CITY"

type 列等于 CITY 很重要,否则可能会返回其他不相关的页面 URL。

无论如何,为了获取用户的所有事件并显示他们的 rsvp 状态,显示有关场地的信息并获取地理位置页面 URL,我正在运行以下多查询 FQL:

[events_query] => SELECT eid, name, pic_square, start_time, end_time, location, description, all_members_count, venue   FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = 6747251459 AND start_time > 0)  AND start_time > 0 AND end_time < now() ORDER BY start_time desc LIMIT 5

[rsvp_query] => SELECT eid, rsvp_status FROM event_member WHERE eid IN (SELECT eid FROM #events_query) AND uid = YOUR_EVENTS_UID

[venue_page_id_query] => SELECT page_id FROM place WHERE page_id IN (SELECT venue.id FROM #events_query)

[venue_info_query] => SELECT page_id, name, page_url, location FROM page WHERE page_id IN (SELECT page_id FROM #venue_page_id_query)

[geo_city_country_query] => SELECT name, page_url FROM page WHERE name IN (SELECT concat(location.city, ', ', location.country) FROM #venue_info_query) AND type = "CITY"

我的问题是,在执行“geo_city_country_query”时,响应速度变慢了很多。大约+5秒。如果没有“geo_city_country_query”查询,响应时间约为 1.5sec-2sec。

有什么办法可以让我更快地完成这项工作吗?

提前致谢!

4

0 回答 0