Read the estimate before you run

The editor shows a byte estimate and a price before you run a query, and some tables refuse a query with no date filter. Reading both takes a few seconds.

How it works

fact_mot_test and fact_defect require a filter on completed_date, so a forgotten date range stops before anything is read. For a query that is accepted, the editor shows the list price for the US multi-region: the billed bytes divided by 2^40 and multiplied by the on-demand rate of $6.25 per TiB.

Common mistake

A query that costs a fraction of a cent is cheap once and costly in a dashboard that refreshes every minute and misses the cache. Multiply the price by the number of billed runs, and subtract the free first TiB of the month.

Worked example

SELECT COUNT(*) AS tests
FROM `learn.mot.fact_mot_test`
WHERE completed_date BETWEEN '2024-03-01' AND '2024-03-31'

The filter on completed_date meets the requirement and selects the March partition.

Read the estimate in the editor before you run the query.

All BigQuery lessons