oso
oso copied to clipboard
Use bigquery usage statistics to measure costs
What is it?
We can better measure our usage of bigquery by making queries like this:
SELECT *
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
--`region-us` gets results for all jobs in the US region
This query allows us to track usage data for each of our queries. The schema is defined here. We should be able to determine the total bytes processed as actually see the most costly queries here. Additionally, each of the jobs listed has the user that executed the job as well as a plethora of other potentially useful information to understand the operation of each query.
To determine costs, we would simply need to multiply "bytes processed" by bigquery's pricing model.