Estimating BigQuery on-demand query cost with a dry run

ACE By islever Editorial Last updated

Short answer

B Run a bq dry run to estimate bytes read, then convert that bytes estimate to dollars with the Pricing Calculator.

Question

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?
  1. Arrange to switch to Flat-Rate pricing for this query, then move back to on-demand.
  2. 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. Correct Answer
  3. 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.
  4. 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.

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

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?

A dry run via 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?

On-demand pricing charges for bytes processed, not rows scanned. A COUNT(*) returns a row total, which cannot be converted to dollars because row sizes vary.

How do I convert dry-run bytes into a dollar cost?

Take the bytes-read estimate from the dry run, convert it to TiB, and multiply by the current on-demand rate using the Google Cloud Pricing Calculator.

More ACE FAQ →

Community Votes

B
83%
D
8%
C
9%

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

  1. ESP_SAP 👍 47
    Correct Answers is (B): On-demand pricing Under on-demand pricing, BigQuery charges for queries by using one metric: the number of bytes processed (also referred to as bytes read). You are charged for the number of bytes processed whether the data is stored in BigQuery or in an external data source such as Cloud Storage, Drive, or Cloud Bigtable. On-demand pricing is based solely on usage. https://cloud.google.com/bigquery/pricing#on_demand_pricing
  2. Buruguduystunstugudunstuy 👍 7 Answered B
    The correct answer is Option B. Running a dry run query using the command line can estimate the number of bytes read by the query, which can then be used to estimate the cost of running the query using the Pricing Calculator. To estimate the cost of a BigQuery query, you can use the bq command-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
  3. saurabh1805 👍 7
    Correct answer is B as dry run work on reading amount of data read not retrurned and price is based on that. https://cloud.google.com/bigquery/docs/estimate-costs
  4. YourCloudGuru 👍 6 Answered B
    The correct answer is B. This option is the most accurate way to estimate the cost of your query, because it takes into account the actual number of bytes that will be processed by BigQuery. Here is an example of how to run a dry run query in BigQuery: bq dry run --query "SELECT * FROM <dataset>.<table> WHERE <condition>" This command will print the estimated number of bytes that will be processed by BigQuery. You can then use the Pricing Calculator to convert this bytes estimate to dollars. Once you have estimated the cost of your query, you can decide whether or not to proceed with running it. If you decide to proceed, you can monitor the cost of your query using the BigQuery Monitoring Console.
  5. ashrafh 👍 4
    Issuing a query dry run 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. I copied from google documentation notice its read*
Show 25 more comments
  1. samurnin 👍 4
    B -> "On-demand queries are charged based on the number of bytes read."
  2. professor 👍 4
    Ans is B Bytes Read
  3. Partha117 👍 3 Answered B
    Calculation should be on bytes read
  4. Purshartha 👍 3 Answered B
    number of bytes read
  5. haroldbenites 👍 3
    Go for B
  6. victory108 👍 2
    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.
  7. shawnkkk 👍 2
    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.
  8. AzureDP900 👍 2
    B is right . number bytes read instead of number of byte returned.
  9. aramisrocha 👍 2 Answered B
    B, You need check bytes read
  10. leogor 👍 2
    B, READ but not RETURNED
  11. RanjithK 👍 2
    Answer is B
  12. yomi95 👍 1 Answered B
    A 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
  13. Finger41 👍 1
    B 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.
  14. Captain1212 👍 1
    yes B is the correct answer, biq query charges for queries by using one metric
  15. yvinisiupacuando 👍 1
    B is the Right answer, it returns the bytes read.
  16. presi 👍 1
    Obviously ,the best answer here is B and not c.
  17. Ashii 👍 1
    Bytes scanned or bytes read always !
  18. KunK 👍 1
    B, it's read instead of return
  19. Chotebhaisahab 👍 1
    agree B is the Correct option.
  20. BlueJay20 👍 1 Answered B
    Calculation on bytes read.
  21. BAofBK 👍 1
    The correct answer is B
  22. vikram___ 👍 1
    Correct answer is B !
  23. naresh136 👍 1
    B is correct answer.
  24. beginnercloud 👍 1
    Correct answers is B
  25. vmart 👍 1
    B is correct answer

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All ACE Questions

Access 84 questions with complete answers and detailed explanations.

View Full ACE Practice Test →

← Back to ACE Study Guide