2

我有一个多重查询来获取有关我的朋友和他们喜欢的页面的一些数据。

{ 
  "query1": "SELECT uid, name, pic_square,birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY birthday_date",
  "query2": "SELECT uid, page_id FROM page_fan WHERE uid IN (SELECT uid FROM #query1)",
  "query3": "SELECT page_id,name,type,categories FROM page where page_id IN (SELECT page_id FROM #query2)"
}

大约一个月前我测试了这个多查询,它工作得非常好,事实上我什至有我从这个多查询收集的数据但是当我昨天再次尝试时,我得到了一个错误

{
  "error": "Request failed"
}

我有执行此操作的适当权限。

奇怪的是,当我限制我的查询时,它会成功返回。

{ 
  "query1": "SELECT uid, name, pic_square,birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY birthday_date",
  "query2": "SELECT uid, page_id FROM page_fan WHERE uid IN (SELECT uid FROM #query1) LIMIT 20",
  "query3": "SELECT page_id,name,type,categories FROM page where page_id IN (SELECT page_id FROM #query2)"
}

现在有什么限制吗?我怎样才能让它工作?

4

1 回答 1

0

它是一个分页问题。显然,一个用户有很多联系人(2k+),除非你一次获取 - 比如说 - 1K,否则 api 会中断。

于 2014-04-16T01:23:06.273 回答