Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Flex slots and bytes billed

Hey,

I've been testing flex slots in my company to bring the costs of scheduled queries down and have managed to successfully create a commitment, reservation and assignment to my project through BQ UI using SQL as shown here: https://cloud.google.com/bigquery/docs/reservations-get-started

While the flex slots were active I ran a query in BQ UI that processed 117.7 GB. In the "Job Information" section of the results, I can see that the query was executed under the reservation I have created, which seems OK.

However, when I wanted to check what I was billed for the query, I ran the following query (with relevant WHERE statement) to get the information about my job:

SELECT * FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT

I was surprised to see that value in "total_bytes_billed" column is not 0 - instead it's basically the same as the value in "total_bytes_processed", while the value in "reservation_id" column matches the one I saw in Job Description earlier.

I expected "total_bytes_billed" value to be 0 since the query was run under a flex slot reservation.

Could someone please answer the following two questions:

1. Does reservation_id indicate that the query did indeed run under a flex slot reservation and that the bytes processed will not be billed as if the query was on-demand (even though bytes billed value from information_schema is not 0)?

2. Is there anything else I can do to confirm that the job has been run under a reservation and the query cost will not be charged per byte?

Best regards,

Klemen

0 1 653
1 REPLY 1

Note - after several hours of searching I finally found the answer to 1.:

https://cloud.google.com/bigquery/docs/information-schema-jobs

According to the information schema definition the bytes billed is merely informational:

"If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only."

I still however am curious about question 2.