Skip to content

Instantly share code, notes, and snippets.

@pentium10
Last active September 13, 2025 17:56
Show Gist options
  • Select an option

  • Save pentium10/b769e3da2b5909b88740f2226ee43a6e to your computer and use it in GitHub Desktop.

Select an option

Save pentium10/b769e3da2b5909b88740f2226ee43a6e to your computer and use it in GitHub Desktop.
DECLARE var_day STRING DEFAULT '2025-09-01';
SELECT creation_time,
round(6.5* (total_bytes_processed/POWER(2,40) ),2) AS processedBytesCostProjection,
round(6.5* (total_bytes_billed/POWER(2,40) ),2) AS billedBytesCostInUSD
from `prj_id.region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
where creation_time BETWEEN timestamp(var_day) and TIMESTAMP_add(timestamp(var_day), INTERVAL 1 DAY)
and job_type = "QUERY"
ORDER BY processedBytesCostProjection desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment