TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

BigQuery pricing model cost us $10k in 22 seconds

22 点作者 hliyan大约 2 个月前

7 条评论

jerrygenser大约 2 个月前
When I started using bigquery almost 10 years ago, it was obvious from the documentation and running queries in the console that LIMIT does not change the price of the query since it doesn&#x27;t change the data that needs to be scanned.<p>The user even highlights numerous places in the documentation and hints in the UI which communicate BQ pricing model... so it&#x27;s interesting they decide to post that it&#x27;s hidden or dark pattern.<p>Bigquery has a feature in pre-release stage which will be useful for a limit-like experience while incurring much lower cost.<p><a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;bigquery&#x2F;docs&#x2F;table-sampling" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;bigquery&#x2F;docs&#x2F;table-sampling</a>
willvarfar大约 2 个月前
I have a lot of sympathy for GCP users. There are so many stories of surprise and unpredictable billing.<p>All the cloud providers have foot-guns for the unwary or not-yet-bitten.<p>Although I use GCP all the time, were I to set something up for a friend I would not turn to GCP because of the fear of expensive oopsies.<p>E.g. I wish there were project and per-query options to limit max slot hours and max bytes scanned per query etc.<p>I regularly run really big queries in BQ that can take 10x the slots on some runs just because of &#x27;BQ weather&#x27; and slot contention.
bobchadwick大约 2 个月前
As others have pointed out, it&#x27;s pretty easy to learn that typically using LIMIT doesn&#x27;t affect query cost. That said, one surprising side effect of adding clustering is that LIMIT actually works as you&#x27;d expect it to. See this post by Felipe Hoffa, formerly of Google: <a href="https:&#x2F;&#x2F;hoffa.medium.com&#x2F;bigquery-optimized-cluster-your-tables-65e2f684594b" rel="nofollow">https:&#x2F;&#x2F;hoffa.medium.com&#x2F;bigquery-optimized-cluster-your-tab...</a>.
jpau大约 2 个月前
I am grateful for GCP&#x27;s quotas that help us prevent similar own-goals.<p>While this specific error is something we know to avoid, I&#x27;m sure quotas have helped us avoid the pain of other errors. So I&#x27;m somewhat sympathetic.<p>I think it&#x27;s important to read the language of and judgements in the post in the context of someone who just got a large unexpected bill (expensive lesson).
Rockslide大约 2 个月前
I don&#x27;t have a lot of sympathy for people using their tools wrong. Using partitioning surely would have prevented this.
评论 #43473485 未加载
评论 #43473477 未加载
评论 #43473447 未加载
评论 #43473412 未加载
wodenokoto大约 2 个月前
Big query has an interesting pricing and I do kinda like it. You pay for data in, while processing is basically free.<p>I don’t know the query they used, but limit can limit data scanned.<p>It’s been a long time since I used BQ, but I remember their query optimizer not being particularly advanced, so you had to be really careful where you put the limit.
评论 #43473570 未加载
scottlamb大约 2 个月前
That is a sad story. And I think the referenced doc fragment is even worse than they described; they wrote:<p>&gt; BigQuery <i>charges based on referenced data,</i> not processed data!<p>(emphasis theirs) and linked to a doc that says:<p>&gt; When you run a query, you&#x27;re charged according to the data processed in the columns you select, even if you set an explicit `LIMIT` on the results.<p>I would have interpreted the latter to mean something else, like that you get charged for scanning all rows when you do something like the following:<p><pre><code> select a, sum(b) as b_sum from table group by a order by b_sum limit 10; </code></pre> ...because my post-group LIMIT clause doesn&#x27;t actually prevent it from needing all rows. But their query should genuinely not need all rows. It does need all partitions. I suppose if they have way too many partitions (such that each is &lt;= the minimum fetch size, note: see edit below) then GCP genuinely needs to fetch all the data. Otherwise I am surprised they were charged so much.<p>edit: a caveat on &quot;such that each is &lt;= the minimum fetch size&quot;, I suppose their &quot;select *&quot; together with the columnar format might mean that I should word this as something like each (partition, column) is &lt;= the minimum fetch size.