How to do a query that mimics job history in bigquery console?

When doing a query like

SELECT
  job_id,
  creation_time,
  end_time,
  total_slot_ms,
  query,
  TIMESTAMP_DIFF(end_time, creation_time, MILLISECOND) AS job_duration_seconds,
  SAFE_DIVIDE(total_slot_ms,(TIMESTAMP_DIFF(end_time, start_time, MILLISECOND))) AS avg_slots
FROM
  `region-us`.INFORMATION_SCHEMA.JOBS

the results are much less than what is seen in “job history” in the Big Query console

Is there a way to mimic all the job history, by doing a query?

With the limited information provided, I can only guess you are running most of your jobs in another location other than region-us.

The region-us in Google Cloud Platform (GCP) refers to a broad geographic region encompassing the United States. It’s a general term that doesn’t pinpoint a specific location within the country.

There are also locations outside of region-us.

Not our case

Hi @shinydev ,

Alternatively, you can use the ListJobs API to retrieve the list of jobs submitted to your project.

If the discrepancy continues, please don’t hesitate to reach out to Google Cloud Support. Their team has the specialized expertise to diagnose and resolve complex problems effectively. When you contact them, please include detailed information about the issue and attach screenshots of both discrepancy reports from BigQuery. This will give them the context they need to understand your situation and assist you more efficiently.

I hope the above information is helpful.