Pagination Bigquery每次搜索有限的记录
我正在bigquery中运行下面的查询:Pagination Bigquery每次搜索有限的记录,pagination,google-bigquery,Pagination,Google Bigquery,我正在bigquery中运行下面的查询: SELECT othermovie1.title, (SUM(mymovie.rating*othermovie.rating) - (SUM(mymovie.rating) * SUM(othermovie.rating)) / COUNT(*)) / (SQRT((SUM(POW(mymovie.rating,2)) - POW(SUM(mymovie.rati
SELECT othermovie1.title,
(SUM(mymovie.rating*othermovie.rating) - (SUM(mymovie.rating) * SUM(othermovie.rating)) / COUNT(*)) /
(SQRT((SUM(POW(mymovie.rating,2)) - POW(SUM(mymovie.rating),2) / COUNT(*)) * (SUM(POW(othermovie.rating,2)) -
POW(SUM(othermovie.rating),2) / COUNT(*) ))) AS num_density
FROM [CFDB.CF] AS mymovie JOIN
[CFDB.CF] AS othermovie ON
mymovie.userId = othermovie.userId JOIN
[CFDB.CF] AS othermovie1 ON
othermovie.title = othermovie1.title JOIN
[CFDB.CF] AS mymovie1 ON
mymovie1.userId = othermovie1.userId
WHERE othermovie1.title != mymovie.title
AND mymovie.title = 'Truth About Cats & Dogs, The (1996)'
GROUP BY othermovie1.title
但bigquery仍在处理中需要一段时间。是否有办法对查询和请求进行分页,以便仅获取下10行
WHERE othermovie1.title!=每次mymovie.title和num_density>0
?您在BigQuery中找不到任何与分页结果相关的概念,因此无法提高处理性能
尽管如此,您仍然可以做一些事情来理解为什么需要这么长时间以及如何改进它
对于初学者,我建议使用而不是Legacy,因为前者能够执行一些优化计划,在您的情况下可能会对您有所帮助,例如在加入之前而不是之后发生,如果您使用Legacy,则情况就是这样
您还可以利用来更有效地诊断查询中的瓶颈在哪里;最后,确保遵循中讨论的概念,这可能有助于您调整查询,使其更具性能。谢谢@Willian Fuks