I have a question about billing - trying to reconcile the billing amount that we see on the report vs the total bytes billed from JOBS.
For the JOBS, the query I am using (assumption is $7.5 per TB processed):
select round(sum(total_bytes_billed)/(102410241024*1024)*7.5) from region-asia-northeast1.INFORMATION_SCHEMA.JOBS
where creation_time > current_timestamp() - interval 30 DAY;
For the billing report (https://console.cloud.google.com/billing) : I have filtered the report for last 30 days, selected only BigQuery service (not the BI Engine). Also selected only the relevant project.
The cost as per billing report shows as more than twice the we are getting from JOBS. What could account for the difference?
Including the storage, the costs unmatch with the reports.
The difference between the cost calculated based on the total_bytes_billed from the JOBS table and the cost shown in the BigQuery billing report is likely due to the following factors:
Storage Costs: The JOBS table only reflects the cost of processing data. It does not include storage costs. To get a more accurate estimate of your BigQuery costs, you should also consider the cost of storing your data.
Other BigQuery Features: The JOBS table primarily shows the cost of running queries. However, other BigQuery features, such as streaming inserts, data transfers, exports, DML operations, copying tables, and querying external data sources, can also incur costs.
Partitioned Tables: Costs associated with deleting specific partitions in partitioned tables.
Failed Queries: Queries that fail are still billed based on the bytes processed.
Rounding Differences: The method used to calculate costs based on total_bytes_billed may have rounding differences compared to how Google calculates billing.
Billing Delays: There can sometimes be a delay in reflecting costs in the billing report.
Location: Costs can vary based on the location (region) of data storage and querying.
Caching: Queries that hit the cache aren’t billed but appear in the JOBS table.
To get a more accurate breakdown of your BigQuery costs, you can:
Check the detailed billing report in the Google Cloud Console. This report provides a comprehensive breakdown of all costs associated with your BigQuery usage.
Use the BigQuery cost estimator to help you estimate your BigQuery costs based on your expected usage.
Contact Google Cloud support for any questions or clarifications about your BigQuery costs.