英文:
BigQuery Slow Response on API
问题
我正在将Google BigQuery用作我的应用程序的辅助数据库,用于存储大量数据,我遇到的问题是我的查询是,
> SELECT `column_name` FROM `project.dataset.tbl_nm` WHERE partition_key = value AND cluster_key = value;
这是一个简单的SELECT查询,如果我通过BigQuery控制台执行此查询,它会立即给出结果,但是当我使用Google BigQuery PHP SDK执行相同的查询时,结果非常慢,最少需要6到7秒,我正在使用AWS EC2作为服务器,我不知道问题出在哪里,因为我在各处都放置了时间日志并检查了结果,后来我发现总共花费了6到7秒来获取查询结果,请建议如果有人遇到类似的问题或有任何建议,提前致谢...
英文:
I am using Google BigQuery as a Secondary Database for my application to store large data, i am facing problem in that my query is,
> SELECT `column_name` FROM `project.dataset.tbl_nm` WHERE partition_key = value AND cluster_key = value;
This is a simple SELECT query, if am firing this query through the bigquery console then it gives the result immediately and when i am firing this same query using Google BigQuery PHP SDK then it gives result too slow like it takes minimum 6 to 7 seconds, i am using AWS EC2 as a server, I don't know where the problem occurs like i have placed time logs everywhere and checked the results then i got to know only that total 6 to 7 seconds spends on the get query result, please suggest if anyone have faced similar issue or have any suggestions, thanks in advance...
答案1
得分: 1
你的UI返回了缓存数据,你的API运行了你的查询。
6-7秒并不算太糟糕,通常是3-4秒。
尝试看看你的Python库是否提供了其他运行查询的方式,就像在BigQuery中你可以异步和同步运行查询一样。连接池的错误定时可能会升级到5-6秒。
英文:
Your UI is returning cached data, your api runs your query.
6-7 seconds is not that bad, usually its 3-4 seconds.
Try to see if your python library offers other ways to run the query, as in bigquery you can run a async and sync way a query. A wrong timing on the pooling can escalate to 5-6 seconds.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论