Google Cloud Associate Cloud Engineer — Question 39
You need to run an important query in BigQuery but expect it to return a lot of records. You want to find out how much it will cost to run the query. You are using on-demand pricing. What should you do?
Answer options
- A. Arrange to switch to Flat-Rate pricing for this query, then move back to on-demand.
- B. Use the command line to run a dry run query to estimate the number of bytes read. Then convert that bytes estimate to dollars using the Pricing Calculator.
- C. Use the command line to run a dry run query to estimate the number of bytes returned. Then convert that bytes estimate to dollars using the Pricing Calculator.
- D. Run a select count (*) to get an idea of how many records your query will look through. Then convert that number of rows to dollars using the Pricing Calculator.
Correct answer: B
Explanation
The correct answer is B because running a dry run query in BigQuery allows you to estimate the number of bytes that will be read, which is essential for calculating costs under on-demand pricing. Options A and C are incorrect as they either suggest unnecessary changes to pricing plans or misinterpret the type of estimate needed. Option D is also wrong as counting rows does not provide the necessary information about bytes read for accurate cost estimation.