Skip to content
Finitizer

BigQuery Cost by Source

See what each BigQuery source costs: dbt models, Looker Studio reports, Airflow DAGs, accounts and owners, from your job history.

Google CloudReads your own dataBring a fileVersion 1.0
New here? Try the Training: one worked example, step by step, with a PDF to keep.

Learn more

BigQuery Cost by Source

What this free tool does for you

See what each dbt model, dashboard, DAG, account and owner costs in BigQuery, and how much has no owner.

How to use it

  1. Click Try it with sample data to see a finished result before you run anything.
  2. Pick the Location your data is in and the Owner label your teams use.
  3. Click Copy query, run it in BigQuery and load the result. Query 2 is optional.
  4. Add lines to Who owns what for jobs with no owner label, then click Show cost by source.
  5. Read the tables by tool, owner and model, then Download to share it.

Good to know

  • No guessing. A tool is named only by a mark its maker documents. Other jobs show under their account.
  • Private. Results are read in this browser tab and never sent, not even for a review.

Not sure where to get the data? .

Before you start: what to have readyShow
  • The project the jobs ran in, or the organization. You need BigQuery Job User and BigQuery Resource Viewer.
  • The location your datasets live in. INFORMATION_SCHEMA is regional, so the wrong location returns nothing rather than an error. It also sets the prices.
  • Your owner label, if your teams label jobs, and a list of service accounts and who owns each.

See it before you run anything. The sample is made-up results in the same columns as the real queries.

This changes the queries and the prices. US multi-region list prices: $6.25 per TiB on demand, and $0.06 a slot hour for Enterprise pay as you go, used only to value work that ran on a reservation. In USD, read from Google’s pricing page on 2026-11-07.

How each tool is found
  • dbt: The JSON comment dbt puts in each query, with "app": "dbt" and the model in "node_id", or the same items as job labels. dbt docs, query-comment, read December 1, 2026.
  • Looker Studio: The job label requestor:looker_studio, and looker_studio_report_id for the report. Google, monitor BigQuery data source queries, read December 1, 2026.
  • Looker: Job labels that start looker-context-, or the comment "-- Looker Query Context". Google, Looker BigQuery connections, read December 1, 2026.
  • Connected Sheets: A job ID that starts sheets_dataconnector. Google, Connected Sheets, read December 1, 2026.
  • Airflow: The job labels airflow-dag and airflow-task, which the Google provider adds to the jobs it starts. Apache Airflow, Google provider change 37736, read December 1, 2026.
  • Anything else, such as scheduled queries and Dataform, leaves no mark Google documents, so it shows under the account that ran it. Give that account an owner in your list below.

1. Cost by source

Thirty complete UTC days of query jobs, one row for each project, account, tool and owner label value, with jobs, on-demand bytes billed and slot time. Tools are found by the marks their makers document. It returns dbt model names, report ids and accounts, never query text, and is read in this browser only.

-- Finitizer BigQuery Cost by Source, query 1: cost by where each job came from.
-- One row per project, account, tool and value of the "team" label, with jobs,
-- on-demand bytes billed and slot time. Tools are found by the marks their makers
-- document: dbt's query comment or job labels, Looker Studio's requestor label,
-- Looker's context labels, Connected Sheets' job ID prefix and Airflow's labels.
-- It reads the query text only to find dbt's and Looker's comments, and returns
-- the dbt model name, never the text. Run it in the project the jobs ran in.
-- Window: the last 30 complete UTC days. Run it unchanged.
WITH jobs AS (
  SELECT
    project_id,
    user_email,
    job_id,
    reservation_id,
    IFNULL(cache_hit, FALSE)                                   AS cached,
    (error_result IS NOT NULL AND IFNULL(error_result.reason, '') != 'stopped') AS failed,
    -- What on demand charges: no failed runs, built-in BigQuery ML training at 50 times.
    IF((error_result IS NULL OR error_result.reason = 'stopped'), IFNULL(total_bytes_billed, 0) * IF(statement_type = 'CREATE_MODEL' AND ml_statistics.model_type IN ('LINEAR_REGRESSION', 'LOGISTIC_REGRESSION', 'KMEANS', 'MATRIX_FACTORIZATION', 'PCA', 'ARIMA', 'ARIMA_PLUS', 'ARIMA_PLUS_XREG', 'CONTRIBUTION_ANALYSIS', 'TRANSFORM_ONLY'), 50, 1), 0) AS bytes_billed,
    IFNULL(total_slot_ms, 0)                                   AS slot_ms,
    labels,
    IFNULL(query, '')                                         AS query
  FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
  WHERE creation_time >= TIMESTAMP_SUB(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL 30 DAY)
    AND creation_time < TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY)
    AND job_type = 'QUERY'
    AND (statement_type != 'SCRIPT' OR statement_type IS NULL)
),
marked AS (
  SELECT
    *,
    REGEXP_CONTAINS(query, r'"app"\s*:\s*"dbt"')
      OR IFNULL((SELECT l.value FROM UNNEST(labels) l WHERE l.key = 'app' LIMIT 1) = 'dbt', FALSE)      AS dbt,
    (SELECT l.value FROM UNNEST(labels) l WHERE l.key = 'requestor' LIMIT 1)                     AS requestor,
    (SELECT l.value FROM UNNEST(labels) l WHERE l.key = 'looker_studio_report_id' LIMIT 1)       AS looker_studio_report_id,
    EXISTS(SELECT 1 FROM UNNEST(labels) l WHERE STARTS_WITH(l.key, 'looker-context-'))
      OR STRPOS(query, '-- Looker Query Context') > 0          AS looker,
    STARTS_WITH(IFNULL(job_id, ''), 'sheets_dataconnector')    AS connected_sheets,
    (SELECT l.value FROM UNNEST(labels) l WHERE l.key = 'airflow-dag' LIMIT 1)                   AS airflow_dag,
    (SELECT l.value FROM UNNEST(labels) l WHERE l.key = 'team' LIMIT 1)                  AS owner_label
  FROM jobs
),
sourced AS (
  SELECT
    *,
    IF(dbt, COALESCE(REGEXP_EXTRACT(query, r'"node_id"\s*:\s*"([^"]+)"'), (SELECT l.value FROM UNNEST(labels) l WHERE l.key = 'node_id' LIMIT 1)), NULL)
                                                               AS dbt_model
  FROM marked
)
SELECT
  project_id,
  user_email,
  dbt,
  dbt_model,
  requestor,
  looker_studio_report_id,
  looker,
  connected_sheets,
  airflow_dag,
  owner_label,
  COUNT(*)                                                     AS jobs,
  COUNTIF(cached)                                              AS cached_jobs,
  COUNTIF(failed)                                              AS failed_jobs,
  COUNTIF(reservation_id IS NOT NULL)                          AS reserved_jobs,
  SUM(IF(reservation_id IS NULL, bytes_billed, 0))             AS on_demand_bytes_billed,
  SUM(slot_ms)                                                 AS slot_ms,
  SUM(IF(reservation_id IS NOT NULL, slot_ms, 0))              AS reserved_slot_ms,
  COUNT(*) OVER ()                                             AS result_rows,
  TIMESTAMP_SUB(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL 30 DAY) AS window_start,
  TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY)                     AS window_end,
  'us'                                                AS location,
  'project'                                             AS scope,
  'team'                                               AS owner_label_key,
  '2026-12-01'                                         AS query_version
FROM sourced
GROUP BY project_id, user_email, dbt, dbt_model, requestor, looker_studio_report_id,
  looker, connected_sheets, airflow_dag, owner_label
ORDER BY on_demand_bytes_billed DESC, reserved_slot_ms DESC;
Not added yet

2. The labels in use (optional)

Every label key on the same jobs, with how many values it takes and the cost of the jobs that carry it. It shows which label names owners best.

-- Finitizer BigQuery Cost by Source, query 2 (optional): the labels in use.
-- One row per label key on query jobs in the window: how many values it takes,
-- the jobs that carry it, their on-demand bytes billed and reserved slot time,
-- and up to five of its values. No query text.
-- Window: the last 30 complete UTC days. Run it in the same place as query 1.
SELECT
  l.key                                                        AS label_key,
  COUNT(DISTINCT l.value)                                      AS label_values,
  COUNT(*)                                                     AS jobs,
  SUM(IF(j.reservation_id IS NULL, IF((j.error_result IS NULL OR j.error_result.reason = 'stopped'), IFNULL(j.total_bytes_billed, 0) * IF(j.statement_type = 'CREATE_MODEL' AND j.ml_statistics.model_type IN ('LINEAR_REGRESSION', 'LOGISTIC_REGRESSION', 'KMEANS', 'MATRIX_FACTORIZATION', 'PCA', 'ARIMA', 'ARIMA_PLUS', 'ARIMA_PLUS_XREG', 'CONTRIBUTION_ANALYSIS', 'TRANSFORM_ONLY'), 50, 1), 0), 0))
                                                               AS on_demand_bytes_billed,
  SUM(IF(j.reservation_id IS NOT NULL, IFNULL(j.total_slot_ms, 0), 0))
                                                               AS reserved_slot_ms,
  ARRAY_TO_STRING(ARRAY_AGG(DISTINCT l.value IGNORE NULLS ORDER BY l.value LIMIT 5), ', ')
                                                               AS example_values,
  COUNT(*) OVER ()                                             AS result_rows,
  TIMESTAMP_SUB(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL 30 DAY) AS window_start,
  TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY)                     AS window_end,
  'us'                                                AS location,
  'project'                                             AS scope,
  '2026-12-01'                                         AS query_version
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT j,
  UNNEST(j.labels) l
WHERE j.creation_time >= TIMESTAMP_SUB(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL 30 DAY)
    AND j.creation_time < TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY)
    AND j.job_type = 'QUERY'
    AND (j.statement_type != 'SCRIPT' OR j.statement_type IS NULL)
GROUP BY l.key
ORDER BY on_demand_bytes_billed DESC, reserved_slot_ms DESC, label_key;
Optional

3. Who owns what (optional)

For jobs with no owner label. One line each: a pattern, =, then the owner. A pattern is an account, or starts with dbt:, dag:, report: or project:. A * matches anything. The first matching line wins.

No lines yet.

Each file goes to the right step by its columns.
Your results are read in this browser and never leave it.

Prices verified 7 Nov 2026. Public list prices in USD for 48 BigQuery locations, before any discount you have negotiated.

Want this done on your real bill?

BigQuery Cost Audit: We find the queries, tables and slots driving your BigQuery bill and fix them without slowing anyone down. From $2,500, fixed. Nothing paid upfront.

See the service

Questions

Does it need access to my Google Cloud account?

No. You run a read-only INFORMATION_SCHEMA query in your own console and load the result here. The figures are worked out in your browser.

Is my data sent anywhere?

No. The result names accounts, dbt models and reports, so it is read in this browser tab and never sent, not even for a review. Usage statistics record that a file was read and a size band, never anything in it.

How does it know which tool ran a query?

Only from marks the tools' makers document: dbt's query comment or job labels, Looker Studio's requestor label, Looker's context labels, the Connected Sheets job ID prefix and the Airflow Google provider's labels. A job with no mark shows under the account that ran it. Nothing is guessed.

Why are my scheduled queries not named?

Google's pages name no mark on scheduled query or Dataform jobs, so they show under the account that ran them. Give that account an owner in Who owns what.

Where do owners come from?

From the owner label on each job, team unless you name another. Jobs without it take the first matching line of your owner list: an account, a dbt model, a DAG, a report or a project. The rest have no owner.

What permissions does the query need?

BigQuery Job User where you run it and BigQuery Resource Viewer on the project, or on the organization for the organization view.

How does it treat reservations?

Reserved work is never priced from bytes. Its slot time is valued at the edition's pay as you go rate, to compare it with on-demand work. A reservation bills its slots whether a job uses them or not.

How much does the query cost to run?

INFORMATION_SCHEMA queries bill like any query. In one project, query 1 reads query text to find dbt's and Looker's comments, so a busy project reads more. The console shows an estimate before you run it.

Which prices does it use?

Google's USD list prices for the location you pick, across 48 BigQuery locations, read from its pricing page on 2026-11-07, before the free 1 TiB a month, discounts, credits and taxes.

About this page

A bill shows which project spent. This page shows which dbt model, dashboard, pipeline or person did, from your own job history: each tool is found by the mark its maker documents, and each job is given the owner its label or your own list names.

Every figure is list price for the bytes or slot time those jobs used. The share with no owner is the first thing to fix: nobody can cut a cost nobody owns.

Related tools

More tools for: Analytics and warehouses

A month of history is a snapshot. Owners change every sprint.

Finitizer watches BigQuery continuously: the queries driving scan volume, slot sizing and storage billing, and the savings it verifies against later bills. Read-only.

See how Finitizer works

Rate this tool

How would you rate the BigQuery Cost by Source?