Skip to content
Finitizer
Estimate what a query costs before you run it

This recipe tells you what already happened. The analyzer takes a query you have not run yet and estimates what it will scan, in your browser.

How much are failed queries costing me?

Jobs that consumed slot time or billed bytes and then errored out.

Reads metadata only, a fraction of a cent to run (10 MB minimum)Reviewed against Google’s docs, 23 Oct 2026

Permissions. Needs bigquery.jobs.listAll on the project for JOBS (BigQuery Resource Viewer has it); bigquery.jobs.create to run any query (BigQuery Job User has it).

Pick the region your data is in: every INFORMATION_SCHEMA view here is qualified by region.

-- Failed jobs that still consumed resources.
SELECT
  DATE(creation_time)                                       AS run_date,
  user_email,
  COUNT(*)                                                  AS failed_jobs,
  ROUND(SUM(total_slot_ms) / 1000 / 3600, 2)                AS wasted_slot_hours,
  SUM(total_bytes_billed)                                   AS bytes_billed,
  ANY_VALUE(error_result.reason)                            AS example_reason,
  ANY_VALUE(SUBSTR(error_result.message, 0, 200))           AS example_message
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
  AND job_type = 'QUERY'
  AND IFNULL(statement_type, '') != 'SCRIPT'
  AND error_result IS NOT NULL
GROUP BY run_date, user_email
HAVING wasted_slot_hours > 0 OR bytes_billed > 0
ORDER BY wasted_slot_hours DESC
LIMIT 50;

What it returns

wasted_slot_hours
Slot time consumed by jobs that produced nothing.
example_reason
BigQuery error reason, quotaExceeded, resourcesExceeded, invalidQuery, and so on.

How to read it

  • On demand, a query that ends in an error is not billed for bytes, but canceling one that is running can still cost up to its full price. "I canceled it in time" is usually not true. Under a reservation, the slot time is spent either way.
  • A cluster of resourcesExceeded errors from one user is a query-shape problem, normally an ORDER BY over a huge result set or a runaway self-join.
  • Repeated quotaExceeded means a retry loop somewhere. Find the client, not the query.

Run this once, or have it run every day.

Finitizer evaluates this class of question continuously against your live BigQuery estate, tracks how each number moves between runs, and turns findings into assigned tasks. Read-only and keyless.

See how Finitizer works