Estimating BigQuery on-demand query cost with a dry run
Short answer
B Run a bq dry run to estimate bytes read, then convert that bytes estimate to dollars with the Pricing Calculator.
Question
on-demand pricing. What should you do?
Key Takeaways
The question tests which metric BigQuery on-demand pricing actually bills — bytes read, not bytes returned or rows — and which tool reports it before execution.
To estimate the cost of a large BigQuery query under on-demand pricing, run a dry run with the bq command-line tool to get the bytes read, then convert that figure to dollars using the Pricing Calculator. The correct answer is B.
Common mistake: Option C is the closest trap: a dry run does estimate bytes, but it reports bytes read, not bytes returned, and only the read figure maps to the on-demand price.
Expert Analysis
What the question is really asking The wording pins down three things at once: the pricing model (on-demand), the goal (find out the cost before running), and the method available from the command line. Under BigQuery on-demand pricing, billing is driven by a single metric — the number of bytes processed, also called bytes read — regardless of whether the data lives in BigQuery or an external source. That qualifier "on-demand pricing" immediately kills any answer built on row counts or on bytes returned.
Eliminating the distractors
Option D converts a SELECT COUNT(*) row total into dollars. Rows are not the billing unit for on-demand BigQuery; a single row can be tiny or huge, so a row count can never be mapped to a price. Option C is subtler and traps careful readers: it correctly suggests a dry run but converts bytes returned. A dry run reports bytes read/processed, and it is precisely that read figure that Google multiplies by the per-TiB rate. Option A proposes switching to Flat-Rate for one query and then switching back — Flat-Rate is a committed-capacity model for sustained workloads, it does not produce a per-query estimate, and toggling plans is not a realistic or cost-effective way to price a single query.
Why B is correct
Option B matches the official procedure exactly: run bq with the --dry_run flag (or set dryRun in the API) to obtain the estimated bytes read without executing the query, then multiply that bytes figure by the on-demand rate using the Google Cloud Pricing Calculator. The two qualifiers "dry run" and "bytes read" are what make B the only option that aligns both the tool and the billing metric.
The transferable lesson Always identify the vendor's stated billing unit before choosing a calculation method; the exam repeatedly tests whether you confuse bytes read with bytes returned or rows.
Official Reference
- https://cloud.google.com/bigquery/docs/dry-run-queries
- https://cloud.google.com/bigquery/docs/estimate-costs
- https://cloud.google.com/bigquery/pricing
These links open the official vendor documentation in a new tab.
Exam Strategy
When a question names a pricing model, first recall that model's single billing metric — for BigQuery on-demand it is bytes processed — and eliminate any option built on a different unit such as rows or bytes returned. Then check that the proposed tool actually produces that metric without side effects: --dry_run returns an estimate without executing the query, while switching pricing models or running COUNT(*) does not. This units-plus-tool filter resolves most cost-estimation questions in one pass.
Frequently Asked Questions
What does a BigQuery dry run actually return?
bq --dry_run or the API dryRun parameter returns the estimated number of bytes the query would process (bytes read) without executing it, so you can estimate on-demand cost beforehand.Why can't I use SELECT COUNT(*) to estimate query cost?
How do I convert dry-run bytes into a dollar cost?
Community Votes
83% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 35 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 35
Show 25 more comments
-
samurnin 👍 4B -> "On-demand queries are charged based on the number of bytes read."
-
professor 👍 4Ans is B Bytes Read
-
Partha117 👍 3 Answered BCalculation should be on bytes read
-
Purshartha 👍 3 Answered Bnumber of bytes read
-
haroldbenites 👍 3Go for B
-
victory108 👍 2B - 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.
-
shawnkkk 👍 2B. 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.
-
AzureDP900 👍 2B is right . number bytes read instead of number of byte returned.
-
aramisrocha 👍 2 Answered BB, You need check bytes read
-
leogor 👍 2B, READ but not RETURNED
-
RanjithK 👍 2Answer is B
-
yomi95 👍 1 Answered BA dry run query in BigQuery allows you to estimate the amount of data scanned by your query without actually running it. This is especially useful for queries expected to process a large amount of data. You can use the estimated bytes read to calculate the cost using BigQuery's on-demand pricing model, where costs are based on the amount of data processed
-
Finger41 👍 1B is correct as per : https://cloud.google.com/bigquery/docs/dry-run-queries When you run a query in the bq command-line tool, you can use the --dry_run flag to estimate the number of bytes read by the query. You can also use the dryRun parameter when submitting a query job using the API or client libraries.
-
Captain1212 👍 1yes B is the correct answer, biq query charges for queries by using one metric
-
yvinisiupacuando 👍 1B is the Right answer, it returns the bytes read.
-
presi 👍 1Obviously ,the best answer here is B and not c.
-
Ashii 👍 1Bytes scanned or bytes read always !
-
KunK 👍 1B, it's read instead of return
-
Chotebhaisahab 👍 1agree B is the Correct option.
-
BlueJay20 👍 1 Answered BCalculation on bytes read.
-
BAofBK 👍 1The correct answer is B
-
vikram___ 👍 1Correct answer is B !
-
naresh136 👍 1B is correct answer.
-
beginnercloud 👍 1Correct answers is B
-
vmart 👍 1B is correct answer
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All ACE Questions
Access 84 questions with complete answers and detailed explanations.
View Full ACE Practice Test →
bqcommand-line tool to run a dry-run query. Option A: Arranging to switch to Flat-Rate pricing will not help you estimate the cost of running the query using on-demand pricing. Option C: Estimating the number of bytes returned by the query will not give you an accurate estimate of the cost of running the query using on-demand pricing. Option D: Estimating the number of rows that the query will look through will not give you an accurate estimate of the cost of running the query using on-demand pricing. https://cloud.google.com/bigquery/docs/estimate-costs