Slow BigQuery response

点点圈 提交于 2020-01-16 00:54:47

问题


I've got a relatively small dataset where I'm writing IP log analytics then doing queries against it.

I'm updating BigQuery once per hour with updated stats.

I have 110,000 rows with 37MB of data.

The below query takes anywhere from 7 seconds - 50+ seconds to run:

SELECT SUM(1) as views FROM [statistics.statsLogNSI] WHERE lastedit > DATE_ADD(CURRENT_TIMESTAMP(), -7, "DAY")

My more complex query examples are below:

SELECT SUM(1) as views FROM [statistics.statsLogNSI] WHERE NOT combination contains 'isRobot:True' AND ownerKey = '14013' AND country = 'US' AND lastedit > DATE_ADD(CURRENT_TIMESTAMP(), -7, "DAY")

Do you have a recommendation to optimize this result set? I saw a previous post about 'fragmentation' in BigQuery. Is updating the table once per hour too frequent?

来源:https://stackoverflow.com/questions/25130031/slow-bigquery-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!