How much are failed queries costing me?
Jobs that consumed slot time or billed bytes and then errored out.
Free to run — INFORMATION_SCHEMA scans no billable bytesChecked 4 Aug 2026
JOBS and TABLE_STORAGE are region-scoped.
-- 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 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
- A cancelled query still bills for the bytes it had already scanned under on-demand. "I cancelled it in time" is usually not true.
- 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.