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.
- The refusal says that the query has no filter over the column
completed_datethat can be used for partition elimination. - A TiB is 2^40 bytes, about 1.1 trillion. At list price a query that bills 1 TiB costs $6.25, and the first 1 TiB of each month is free.
- The estimate is made before the run, and the bill comes from the bytes the run processes. Each run that is not served from the cache is billed again.
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.