bigquery-utils icon indicating copy to clipboard operation
bigquery-utils copied to clipboard

Add report showing projects using on demand slots

Open jdub55 opened this issue 2 years ago • 0 comments

Recently encountered an issue with a Customer where they needed to verify if on demand slots were being used for any projects. They wrote this query against INFORMATION_SCHEMA. Is this something we would consider adding to the system tables dashboard?

select project_id,sum(total_bytes_billed) as bytes_billed,sum(total_slot_ms) as slot_ms from region-us.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION where creation_time > TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 24 HOUR) AND job_id not in ( select parent_job_id from region-us.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION where creation_time > TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 24 HOUR) AND parent_job_id is not null ) AND reservation_id is null and parent_job_id is null AND error_result is null AND job_type="QUERY" AND state="DONE" AND priority="INTERACTIVE" and total_bytes_billed >0 group by project_id order by bytes_billed DESC

jdub55 avatar Jun 27 '23 22:06 jdub55