dwhat

Free tool · BigQuery on-demand

BigQuery cost across several projects: a SQL generator

When the bill goes up and your jobs run in more than one project, list the projects and get one query that shows bytes billed and estimated on-demand cost for each, day by day.

Nothing you type leaves this page. The SQL is written by this page's JavaScript; it is not sent, stored, put in the address or run. No account and no cloud credentials needed — you run it yourself.

1. Name the projects and the region

The projects filled in are a fictional example; replace them with yours. Use each project's id, as ingcloud projects list, not its display name or number.

6.25 is an example: the US multi-region list price when this page was written. Prices differ by region, contract and currency, and change — check BigQuery pricing.

2. Copy the query and run it

Run it in the BigQuery console from any project you can run queries in. To read another project's job history you need permission to list everybody's jobs there (bigquery.jobs.listAll, which BigQuery Resource Viewer grants); a project you cannot read makes the whole query fail with an access error, so remove it and run again. Each region is a separate query: INFORMATION_SCHEMA views are regional.

Google's documentation: JOBS view. If you have access to the whole organisation, JOBS_BY_ORGANIZATION covers every project in one view; this generator is for when you can name the projects.

What the query counts, and what it leaves out

Then find out who and what spent it

This query says which project and which day. A free audit of a project's job history says which user, dbt model and dashboard, and which queries cost the most, with fixes the SQL shows evidence for.

Connect a read-only account for a free auditOr audit a CSV export in your browser

Related guides