The idea that Google would give away BigQuery for free if only people would write better SQL queries.
Edit: rereading, I think this is actually for non-interactive scripts, in which case yes it should just cancel the query
Edit 2: https://news.ycombinator.com/item?id=39447499 was kind enough to point out that the resource-based version of this might actually exist, which is nice
You can set the size limit for individual queries. Plus the custom quotas and everything.
Part of the problem is that the OP wrote a script with a loop. So say you set the limit to 50 GiB per query, but then write a script that runs a 49 GiB query 1000 times...
That type of batch process should be designed much more carefully to consider costs.
Are you sure?
The article doesn't say anything about a loop, and the estimated usage by the Google responder makes it seem like the cost is from a single "SELECT *".
> I was doing historical evaluation for a few sites, so I was running a query for each month going back to 2016 for each site. I've done this before with no real issues, and if I knew the charges were rapidly exploding I'd have halted the script immediately - but instead it ran for 2 hours and the first notice I got was the CC charge.
So looks like a loop of ((6 * 12) + 2) * #sites iterations with a full table scan every time.
If nothing else, it can be an example in my SQL 101 course.
`SELECT * FROM super_wide_table_with_lots_of_text WHERE NOT filter_on_partitions_or_clusters`
Select * is dangerous because it's a column store. You really need to look at the schema and select only the things you want. And when exploring the data it's important to use sane limits and pull from a single partition.
SELECT page, url, payload FROM `{table}` WHERE page like '%{site_domain}/%' AND url like '%[EXAMPLE.COM]%'
---
There's no LIMIT on it b/c I actually need all the results.
I'd say!