Medium1 markMultiple Choice
Domain 4.4: Managing storage and database solutionsBigQueryCost EstimationDry RunTroubleshooting

GCP ACE · Question 38 · Domain 4.4: Managing storage and database solutions

You are about to run a complex SQL query in BigQuery that joins several multi-terabyte tables. You are concerned about how much this specific query will cost.

How can you estimate the cost of this query BEFORE executing it?

Answer options:

A.

Execute the query and check the Billing Console immediately afterward.

B.

Use the BigQuery query validator in the Cloud Console or run a dry run using the bq command line to see the estimated bytes processed.

C.

Export the tables to Cloud Storage, check their file sizes, and multiply by the BigQuery per-terabyte rate.

D.

Check the Google Cloud Pricing Calculator and input the number of rows in the tables.

How to approach this question

Recall that BigQuery charges based on data scanned. The UI and CLI both offer a 'dry run' feature to calculate this scan size for free.

Full Answer

B.Use the BigQuery query validator in the Cloud Console or run a dry run using the bq command line to see the estimated bytes processed.✓ Correct
Use the BigQuery query validator in the Cloud Console or run a dry run using the bq command line to see the estimated bytes processed.
BigQuery uses a columnar data structure and charges based on the amount of data (bytes) processed by a query. Before running a query, you can estimate its cost using the 'dry run' feature. In the Cloud Console UI, the query validator automatically displays the estimated bytes processed in the top right corner as you type. Alternatively, you can use the `--dry_run` flag with the `bq query` command. A dry run does not execute the query and is completely free.

Common mistakes

Thinking you have to guess based on table size, forgetting that BigQuery only scans the specific columns requested in the SELECT statement.

Practice the full GCP Associate Cloud Engineer Practice Exam 6

50 questions · hints · full answers · grading

More questions from this exam