我正在开发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”
类型列等于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.5秒-2秒。
我有什么方法可以更快地完成这项工作?
提前致谢!