BigQuery性能 [英] BigQuery Performance

查看:101
本文介绍了BigQuery性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法来稳定查询的响应时间?例如,这两个执行相同查询的作业具有不同的响应时间:

lockquote
JobId:job_gzTkFvGculpLw0tQRMZvj6rskMI查询时间:00:00:09.2827336

JobId:job_9wXD9ONxDoI87lD6lOXZJSEM1aE查询时间:00:00:28.1064037

同一个查询的响应时间差别很大吗?



**编辑:projectId是nostrum.eu:nostrum

解决方案

默认情况下,BigQuery使用查询缓存来加快常见查询的响应时间这可能会被多次使用。

这要记住,如果您将数据不断加载或流式传输到数据库中,这是因为您的缓存查询结果可能不是最多的如果您希望禁用查询缓存,则可以在发送到API的查询正文中设置该参数:




$ b $ kind
$ query $ b $ query
$ defaultDataset:{
datasetId:string,
projectId:string
},
useQueryCache:False
}

这应该使得您的同一个查询的重复请求会有relati vely的响应时间相同,但是您将为每个查询请求收取费用,而不是仅针对缓存结果所需的一个请求开单。


Is there any way to stabilize the response time of queries? For example, this two jobs that execute the same query, have different response times:

JobId: job_gzTkFvGculpLw0tQRMZvj6rskMI Query Time: 00:00:09.2827336

JobId: job_9wXD9ONxDoI87lD6lOXZJSEM1aE Query Time: 00:00:28.1064037

Why does the same query take very different response times?

**EDIT: The projectId is nostrum.eu:nostrum

解决方案

By default, BigQuery uses Query caching to speed up response times for common queries that may be used multiple times.

This is important to remember if you are loading or streaming data constantly into the database, because your cached query results may not be the most up to date results for the query.

If you want to disable query caching, you can set the parameter in the query body that you send to the API:

{
  "kind": "bigquery#queryRequest",
  "query": query,
  "defaultDataset": {
    "datasetId": string,
    "projectId": string
  },
  "useQueryCache": False
}

This should make it so that your repeat requests of the same query will have relatively the same response time, but you will be billed for each query request, as opposed to being billed for just the one request that it takes to cache the results.

这篇关于BigQuery性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆