
Answer-first summary for fast verification
Answer: Perform a dry run query via the command line to estimate the bytes read by the query, then use the Pricing Calculator to translate this byte estimate into a cost.
**Correct Answer: B** - **A** is incorrect because BigQuery charges are based on the amount of data processed in bytes, not the number of records. A `select count (*)` query does not provide an accurate cost estimate. - **B** is correct because a dry run query estimates the bytes read by your query, which directly correlates with the cost under on-demand pricing. This method provides a precise cost estimation before running the actual query. - **C** is incorrect because switching to Flat-Rate pricing involves purchasing dedicated query processing capacity, which is unnecessary and not cost-effective for simply estimating a query's cost. - **D** is incorrect because the cost is based on the bytes read, not the bytes returned by the query. Estimating returned bytes does not accurately reflect the query's cost. For more details, refer to: - [Dry-run queries](https://cloud.google.com/bigquery/docs/dry-run-queries) - [BigQuery pricing](https://cloud.google.com/bigquery/pricing)
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have 1000 GB of user analytics data stored in BigQuery and need to run a query that is expected to return a large number of records. Before executing the query, you wish to estimate its cost under on-demand pricing. What is the best approach to achieve this?
A
Execute a select count (*) query to estimate the number of records your query will process, then use the Pricing Calculator to convert this row count into a cost estimate.
B
Perform a dry run query via the command line to estimate the bytes read by the query, then use the Pricing Calculator to translate this byte estimate into a cost.
C
Switch to Flat-Rate pricing temporarily for this query to estimate the cost, then revert back to on-demand pricing.
D
Conduct a dry run query using the command line to estimate the bytes returned by the query, then apply the Pricing Calculator to convert this byte estimate into a cost.