BLUENEXUS INTEGRATIONSHOW-TO

How to cap BigQuery query costs before they run: dry runs, byte limits and daily quotas

BigQuery's on-demand pricing bills for the data a query reads, not the rows it returns. A quick look at a big table, with SELECT * and LIMIT 10, can still read all of it. Most of the time that's a few cents. Now and then it's thousands of dollars: one user of the public HTTP Archive dataset reported a $14,000 charge in two hours.

BigQuery has the brakes built in. A dry run shows a query's size before it runs, a byte limit stops a query before it's billed, tables can refuse to be read in full, and daily quotas cap each person. An AI connected to BigQuery can find the big queries and check sizes. Setting the limits stays with whoever owns the project.

Here are four steps, three prompts, and how an online retailer puts limits in place in one week.

Four steps, in this order

Four steps, in this order

See who scans whatRank last month's queries and people by bytes billed, from your job history.
Check before you runA dry run shows how much data a query would read, for free.
Cap each query and tableA byte limit stops a query before it's billed. A partition filter rule stops full-table reads.
Cap each dayDaily quotas per person and per project stop runaway days.

How BigQuery bills a query

  • By data read. On-demand queries cost $6.25 per TiB processed in US locations, with the first 1 TiB each month free.
  • By column, not row. BigQuery reads whole columns. Google says that on tables that aren't clustered, LIMIT doesn't change how much is read. Fewer columns and a date filter do.
  • Estimates are an upper bound. Google calls a dry run's estimate an upper bound, so the final bill can be lower.
  • Previews are free. Table preview in the console shows rows at no charge.

Start with BigQuery's own tools

The console shows each query's estimated size before you run it. Maximum bytes billed makes a query fail without a charge if it would read more. Partitioned tables can require a filter on the partition column, so a query without one fails. Custom quotas cap data processed per day, per user and per project. Each user is unlimited by default, and the project default is 200 TiB a day. And INFORMATION_SCHEMA.JOBS keeps 180 days of jobs, with who ran each one and the bytes billed.

What's left is deciding where each limit goes, and telling people before a query starts failing.

Do it in Claude or ChatGPT

Connect BigQuery with our guide to BigQuery in Claude, ChatGPT and MCP. All three prompts only read. The first and last still run small queries, which are billed.

Who scans what.

1Paste this into Claude or ChatGPT

Using BigQuery, from INFORMATION_SCHEMA.JOBS in region-[us], list the 20 queries with the most bytes billed in the last 30 days, with who ran them, the tables they read, and whether they filtered on a date. Don't change anything.

Copy prompt

Check a query's size.

1Paste this into Claude or ChatGPT

Dry run this query and tell me how many GiB it would process and what that costs at on-demand rates. Don't run it. [paste query]

Copy prompt

Large tables.

1Paste this into Claude or ChatGPT

List the tables over [100] GiB in [dataset], with whether each is partitioned or clustered, and whether it requires a partition filter. Suggest changes, but don't make them.

Copy prompt

A few things to know:

  • Start with a per-person limit. A project quota stops BigQuery for everyone in the project once it's reached. A per-user quota stops only that person, or that service account.
  • Quotas reset at midnight Pacific Time. Lowering one takes effect in minutes. Raising one goes through an approval and can take longer.
  • Check scheduled queries first. A partition filter rule breaks any query without a date filter, including ones that run at night.
  • On-demand only. Custom quotas apply to on-demand pricing, not to capacity pricing with Editions.

When the whole company queries one project

On your own, you'd watch your own queries. In a growing company, marketing, ecommerce and finance all query the same project, the data lead sets the limits, and nobody sees a big query until the invoice.

Bluewren Retail, an 80-person online homeware retailer in Portland, Oregon, watches its BigQuery usage in BlueNexus. BigQuery is connected, and anything that changes it waits for Quinn. Every Monday at 08:00, the data agent reads last week's job history and the settings of the largest tables, and prepares what needs a decision for Quinn, the data lead.

Illustration of the BlueNexus app with example data.

Illustration of the BlueNexus app with example data.

Last week, 5.2 TiB was billed. Four queries over 100 GiB account for 1.9 TiB, all reading the full GA4 export when the question was about one week. Two large tables can still be read in full, and nobody has a daily limit. The agent prepares the next steps for Quinn.

Quinn approves. On Wednesday 11 November, Arden finds one nightly report on web_sessions without a date filter and adds one. The filter rule goes on Thursday 12 November. Quinn sets a daily limit of 1 TiB per person in Google Cloud, well above anyone's normal day.

Illustration of the BlueNexus app with example data.

For connecting BigQuery, see BigQuery in Claude, ChatGPT and MCP. For the team, see why GA4 and BigQuery numbers differ, and how a team agrees on one set. To keep BigQuery costs in check with your team, sign up for BlueNexus.

Questions people ask about Google BigQuery and AI

How do I estimate the cost of a BigQuery query before running it?

Do a dry run. BigQuery checks the query and returns how many bytes it would process, without running it or charging for it. The console shows the same estimate before you click Run.

Does LIMIT reduce BigQuery costs?

Not on tables that aren't clustered. Google says LIMIT doesn't change the amount of data read, so you're billed for the columns you select across the whole table. Select fewer columns and filter on the partition column instead.

Can I set a spending limit in BigQuery?

You can cap bytes per query with maximum bytes billed, which makes a query fail without a charge if it would read more. Custom quotas cap the data processed per day for each user and for the whole project, on on-demand pricing.

How do I find which queries are driving my BigQuery bill?

Query INFORMATION_SCHEMA.JOBS for your region. It keeps 180 days of jobs, with who ran each one, the query text and total bytes billed.

Do AI queries on BigQuery cost money?

Yes. A query an AI runs is billed like any other. Give AI tools read-only roles, ask for dry runs, and set a daily limit per user.

Subscribe to our blog

Product insights, AI and product thinking delivered to your inbox.