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?
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 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
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
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.
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
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ESP_SAP
Highly Voted 3 years, 6 months agoAgents89
Highly Voted 3 years, 10 months agoyomi95
Most Recent 2 months agoBAofBK
3 months, 4 weeks agoEvan7557
4 months, 3 weeks agoYourCloudGuru
5 months, 1 week agoCaptain1212
6 months agocertified28
8 months, 4 weeks agoPartha117
11 months, 2 weeks agoBlueJay20
1 year agoaramisrocha
1 year, 1 month agopresi
8 months, 4 weeks agoBuruguduystunstugudunstuy
1 year, 2 months agoPurshartha
1 year, 3 months agoleogor
1 year, 4 months agoRanjithK
1 year, 8 months agoAzureDP900
1 year, 8 months agoharoldbenites
1 year, 9 months ago