Google BigQuery

BigQuery query history: how to find, query and audit past jobs

BigQuery keeps every query you run as a job for six months. This guide shows where to find that history in the console, how to query it with INFORMATION_SCHEMA.JOBS, what each query cost, how to cancel a running job and why a query can be missing.

Google BigQueryIevgen Krasovytskyi10 min read

BigQuery query history: how to find, query and audit past jobs

BigQuery query history lives in the Job history tab of the Explorer pane: Personal history lists the queries you ran, Project history lists everyone’s. BigQuery keeps both for six months, and the same records are queryable in SQL through the INFORMATION_SCHEMA.JOBS views.

This guide covers the console path, the SQL, what the history can and cannot tell you, how to cancel a job from it, and what to do when a query you expect is not there.

Note: Originally published in August 2025. Fully updated in October 2026 for the current BigQuery Studio layout and the current INFORMATION_SCHEMA.JOBS schema, with every query re-run.

Reading to get this done?

Where to find query history in the BigQuery console

Where to find query history in the BigQuery console

Every query you run in BigQuery is a job, so the console calls query history Job history. The path, from Google’s Manage jobs documentation (checked October 2026):

  1. Open the BigQuery page in the Google Cloud console.
  2. In the left pane, click Explorer. If the pane is hidden, click Expand left pane.
  3. In the Explorer pane, click Job history.
  4. Choose Personal history for your own recent jobs, or Project history for the recent jobs of everyone in the project.
  5. Click a job to open its details.

The job details show the job ID, the user, the start and end time, bytes processed and bytes billed, and for a query job the SQL text. From there, Open as new query puts the SQL back in the editor so you can run or change it.

Two details save time. The newest jobs are listed first. And the duration you see is end time minus start time, not minus creation time, so a job that waited in a queue looks faster than it felt.

If you are not a project owner, Project history may show less than you expect. The reasons are in the section on missing queries below.

Query history, job history and saved queries are three things

Query history, job history and saved queries are three things

The three names get used interchangeably, and they are not the same.

  • Query history is the informal name for the list of query jobs you have run. The query editor also keeps a short, session-only list in its Query results pane.
  • Job history is the persistent, project-wide log of every job: queries, loads, exports and copies. This is what the six-month retention applies to.
  • Saved queries are files you chose to keep. They live under Files in the left pane and have their own Version history.

So if you are looking for a query you ran last week and never saved, go to Job history. If you are looking for a query a colleague shared with you by name, go to Files.

Hand this to your AI

A number in last month's report came from a query someone ran, and you can't find which one in a long list of jobs.

Paste this into your AI assistant. It queries INFORMATION_SCHEMA.JOBS in your BigQuery project to find the jobs that read or wrote a table, who ran them and which ones failed.

The prompt

search my BigQuery job history for the queries that read or wrote the table behind my report, and show who ran each one, when, and which ones failed

How long BigQuery keeps query history

How long BigQuery keeps query history

BigQuery saves a six-month job history for all the jobs of a project, in all locations. The INFORMATION_SCHEMA.JOBS views state the same window as 180 days, and they include jobs that are still running.

Three limits follow from that:

  • Older than six months is gone. If you need a longer record, copy the history into your own table on a schedule. The query for that is at the end of this guide.
  • A project that moves into an organization loses the view of its past. Google’s documentation says job information from before the migration date is not accessible through the view.
  • You cannot delete a query from the console history. You can delete the metadata of a finished job with bq rm -j or the Python client, which Google documents as a way to remove sensitive text from a query statement. Nothing restores it afterwards.

Query your history with INFORMATION_SCHEMA.JOBS

Query your history with INFORMATION_SCHEMA.JOBS

The console is fine for finding one query. For questions like “what did I run on Tuesday” or “which query cost the most this month”, query the history itself.

There are two views to know:

View What it contains Role you need
JOBS_BY_USER jobs you submitted in the current project BigQuery User
JOBS every job in the current project BigQuery User and BigQuery Resource Viewer

Both need a region qualifier, and the query has to run in the same location as the view. Replace region-us with your own region, for example region-eu.

Always filter on creation_time. The underlying data is partitioned by it, and a query over these views is billed like any other. Without the filter you scan all 180 days.

Your own queries from the last seven days

SELECT
  creation_time,
  job_id,
  state,
  error_result.reason AS error_reason,
  ROUND(total_bytes_billed / POW(1024, 3), 2)
    AS gib_billed,
  TIMESTAMP_DIFF(end_time, start_time, SECOND)
    AS seconds,
  LEFT(query, 80) AS query_start
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_USER
WHERE creation_time >= TIMESTAMP_SUB(
    CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
ORDER BY creation_time DESC;

state is PENDING, RUNNING or DONE. A failed job is also DONE; what tells you it failed is a non-empty error_result. That is the single most common misreading of this view.

Who ran what, and what it cost

SELECT
  user_email,
  COUNT(*) AS queries,
  COUNTIF(error_result IS NOT NULL) AS failed,
  COUNTIF(cache_hit) AS served_from_cache,
  ROUND(SUM(total_bytes_billed) / POW(1024, 4), 3)
    AS tib_billed,
  ROUND(SUM(total_slot_ms) / 1000 / 3600, 1)
    AS slot_hours
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(
    CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
  AND job_type = 'QUERY'
  AND statement_type != 'SCRIPT'
GROUP BY user_email
ORDER BY tib_billed DESC;

total_bytes_billed is the number that maps to an on-demand bill; total_slot_ms is the one that matters if the project runs on reservations. Service accounts show up here next to people, which is usually where the surprise is. Excluding SCRIPT avoids counting a multi-statement script and its child jobs twice. If one of those accounts is an AI assistant, the same view shows every query it wrote: see auditing an AI assistant on BigQuery.

For how those bytes turn into money, see BigQuery pricing.

Queries that failed this week

SELECT
  creation_time,
  user_email,
  job_id,
  error_result.reason AS reason,
  error_result.message AS message
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(
    CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
  AND error_result IS NOT NULL
ORDER BY creation_time DESC;

Columns worth knowing

The view has more than forty columns. These carry most of the answers:

  • query: the SQL text.
  • user_email: who submitted the job, a person or a service account.
  • total_bytes_processed and total_bytes_billed: the scan, and the part you pay for.
  • total_slot_ms: compute used, in slot-milliseconds.
  • cache_hit: whether the result came from cache.
  • referenced_tables and destination_table: the base tables the query read and where it wrote. A view never appears in referenced_tables: BigQuery lists the tables underneath it, and the views themselves, nested ones included, go to referenced_logical_views.
  • labels: key-value tags set by the tool that ran the query.
  • error_result: the reason and message when a job failed.

The full list is in Google’s JOBS view reference.

Which queries show up in your history

Which queries show up in your history

Everything that runs as a job is recorded: queries from the console, the bq tool, the API, scheduled queries, and the dashboards and tools that query BigQuery on your behalf. What decides where you see a job is who submitted it.

Personal history and JOBS_BY_USER show jobs submitted under your own identity. A query that a tool runs through a service account is in the project’s history under that service account, not in yours.

Tools often label their jobs, which is how you tell them apart. Looker Studio is the documented example (Google has called the product Data Studio again since April 2026, and the labels still say looker_studio). Every job it runs carries looker_studio_report_id and looker_studio_datasource_id labels:

SELECT
  (SELECT l.value FROM UNNEST(labels) AS l
   WHERE l.key = 'looker_studio_report_id')
    AS report_id,
  COUNT(*) AS queries,
  ROUND(SUM(total_bytes_billed) / POW(1024, 3), 1)
    AS gib_billed
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(
    CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND EXISTS (
    SELECT 1 FROM UNNEST(labels) AS l
    WHERE l.key = 'requestor'
      AND l.value = 'looker_studio')
GROUP BY report_id
ORDER BY gib_billed DESC;

The report ID is the last part of the report’s URL, so this tells you which dashboard is spending the bytes. The source is Google’s page on analyzing data with Data Studio.

How to cancel a job from job history

How to cancel a job from job history

You can cancel a job that is PENDING or RUNNING. Three ways:

  • In the console, while the query runs in the editor, click Cancel.
  • In SQL, with the job ID from job history:
CALL BQ.JOBS.CANCEL('JOB_ID');
  • On the command line, with bq cancel JOB_ID.

For a job in another project in the same region, pass 'PROJECT_ID.JOB_ID'.

Cancelling usually completes in under a minute, and it is not guaranteed: the job may have finished before the request arrived. A cancelled job can still cost money, depending on the stage it reached. You can cancel your own jobs with the BigQuery Job User role; cancelling someone else’s needs BigQuery Admin.

Why a query is missing from your history

Why a query is missing from your history

Five causes cover nearly every case.

  1. You are looking at Personal history and someone else ran it. Switch to Project history, or query JOBS instead of JOBS_BY_USER.
  2. You can list jobs but not read them. With bigquery.jobs.list alone, jobs submitted by other users appear with their details redacted. Seeing them in full takes bigquery.jobs.listAll, which BigQuery Resource Admin and BigQuery Admin include. See IAM roles and permissions in BigQuery.
  3. Wrong region. region-us returns nothing for jobs that ran in the EU. The view is per region.
  4. Wrong project. A job belongs to the project that was billed for it, which is the first part of its ID: project:region.job_id. A query over another project’s tables is still in your project’s history.
  5. It is older than six months, or its metadata was deleted.

Query history and audit logs answer different questions

Query history and audit logs answer different questions

Job history tells you what a query did: the SQL, the bytes, the slots, the duration. Cloud Audit Logs tell you who did what, where and when across the project, including actions that never create a job, such as changing a table’s permissions.

Google’s introduction to audit logs draws the line this way: audit logs record the API calls but not their impact, so the time and slots a query used are in INFORMATION_SCHEMA and not in the audit log. For a security or compliance question, audit logs are the primary source. For a cost or performance question, job history is.

Keep more than six months

Keep more than six months

If you want a year of history for cost reviews, append yesterday’s jobs to your own table with a daily scheduled query:

SELECT
  creation_time,
  job_id,
  user_email,
  statement_type,
  total_bytes_billed,
  total_slot_ms,
  cache_hit,
  error_result.reason AS error_reason,
  query
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE DATE(creation_time) = DATE_SUB(
    CURRENT_DATE(), INTERVAL 1 DAY)
  AND job_type = 'QUERY';

Set the scheduled query to append to a table partitioned by date. The query column holds SQL text, which can contain names, emails and filter values, so treat the table as sensitive.

What query history cannot tell you

What query history cannot tell you

Job history is a complete record of what ran. It is not a record of what is right. Open any project’s history and you will find the same revenue query a dozen times, each with a slightly different join or date filter, and nothing that marks which one the monthly report was built on.

This query surfaces those repeats. It groups jobs by query_hashes.normalized_literals, a hash that ignores literal values, so the same query with a different date counts as one:

SELECT
  query_info.query_hashes.normalized_literals
    AS query_hash,
  ANY_VALUE(LEFT(query, 120)) AS query_start,
  COUNT(*) AS runs,
  COUNT(DISTINCT user_email) AS users,
  ROUND(SUM(total_bytes_billed) / POW(1024, 3), 1)
    AS gib_billed
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(
    CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
  AND job_type = 'QUERY'
  AND error_result IS NULL
  AND query_info.query_hashes.normalized_literals
    IS NOT NULL
GROUP BY query_hash
HAVING runs > 1
ORDER BY gib_billed DESC
LIMIT 20;

A query that several people run every week is no longer an ad hoc query. It is a dataset the business depends on, kept in people’s editors. The fix that lasts is to write it once, give it an owner and a description, and stop re-deriving it. A view does the first part. It does not record who owns the logic or who is using it.

That is the job of a Data Mart in OWOX Data Marts: the SQL you already wrote, saved with its owner and description, and delivered as reports to Google Sheets, Data Studio or Slack. OWOX does not rewrite or transform the query. It runs your SQL in your warehouse, and each run is listed in Run History with its status, so “where did this number come from” has an answer that is not a search through six months of job history.

Run History in OWOX Data Marts listing scheduled connector and report runs with their Data Mart, time and Success status – every run of a published query is recorded in one place

Hand this to your AI

A number in last month's report came from a query someone ran, and you can't find which one in a long list of jobs.

Paste this into your AI assistant. It queries INFORMATION_SCHEMA.JOBS in your BigQuery project to find the jobs that read or wrote a table, who ran them and which ones failed.

The prompt

search my BigQuery job history for the queries that read or wrote the table behind my report, and show who ran each one, when, and which ones failed

FAQ

Frequently Asked Questions

Can I use SQL to retrieve past queries in BigQuery?

Yes. INFORMATION_SCHEMA.JOBS_BY_USER returns the jobs you submitted and INFORMATION_SCHEMA.JOBS returns every job in the project. Both need a region qualifier such as `region-us`, and both should be filtered on creation_time, because a query over these views is billed like any other.

Can I delete a query from BigQuery job history?

Not from the console. You can delete the metadata of a finished job with `bq rm -j` and the job ID, or with the Python client. Google documents this as a way to remove sensitive information from a query statement. A deleted job cannot be restored.

What is the difference between job history and saved queries in BigQuery?

Job history is the automatic log of every query, load, export and copy job, kept for six months. Saved queries are files you chose to keep: they are under Files in the left pane and have their own version history. A query you ran and never saved is only in job history.

Why can't I see a query in my BigQuery history?

Usually one of five reasons: someone else ran it, so it is in Project history and not Personal history; you have bigquery.jobs.list but not bigquery.jobs.listAll, so other users' jobs are redacted; you are querying the wrong region; the job belongs to another project; or it is older than six months.

How long does BigQuery store query history?

Six months. BigQuery saves a six-month job history for all the jobs of a project, and the INFORMATION_SCHEMA.JOBS views cover the same window as 180 days. To keep a longer record, append the view to your own table with a daily scheduled query.

Where is query history in BigQuery?

In the Google Cloud console, open BigQuery, click Explorer in the left pane, then Job history. Personal history lists the jobs you ran and Project history lists the jobs of everyone in the project. Click a job to see its SQL, user, duration and bytes billed.

Who wrote this

Ievgen Krasovytskyi

Ievgen Krasovytskyi Head of Marketing

Ievgen Krasovytskyi is the Head of Marketing at OWOX, leading strategy across content, SEO, product marketing, and AI-powered automation. With deep expertise in analytics infrastructure, data warehouses, and marketing technology, he builds systems that connect marketing performance to business outcomes. Ievgen writes about SaaS growth, analytics workflows, and the future of AI in marketing operations.