BigQuery中,我們試圖運行:如何使此查詢有效運行?
SELECT day, AVG(value)/(1024*1024) FROM (
SELECT value, UTC_USEC_TO_DAY(timestamp) as day,
PERCENTILE_RANK() OVER (PARTITION BY day ORDER BY value ASC) as rank
FROM [Datastore.PerformanceDatum]
WHERE type = "MemoryPerf"
) WHERE rank >= 0.9 AND rank <= 0.91
GROUP BY day
ORDER BY day desc;
返回的數據相對較少。但我們得到的消息:
Error: Resources exceeded during query execution. The query contained a GROUP BY operator, consider using GROUP EACH BY instead. For more details, please see https://developers.google.com/bigquery/docs/query-reference#groupby
什麼使這個查詢失敗,子查詢的大小?是否有一些等價的查詢可以避免這個問題?
編輯迴應評論:如果我添加組分別由(落外ORDER BY),查詢失敗,聲稱GROUP分別由這裏不是並行。
您是否嘗試過使用「GROUP EACH BY」作爲錯誤消息提示? – hexafraction
如果我添加GROUP EACH BY(並刪除外部ORDER BY),則查詢失敗,聲稱GROUP EACH BY在這裏不可並行化。有什麼我失蹤? –
添加到您的文章。我只是試圖幫助使其負責,不太可能被擱置「 – hexafraction