Estimate what a query costs before you run it
This recipe tells you what already happened. The analyzer takes a query you have not run yet and estimates what it will scan, in your browser.
Which GCP SKUs am I spending the most on?
The SKU-level breakdown behind a service total.
Costs money to run, queries your billing export tableReviewed against Google’s docs, 23 Oct 2026
Permissions. Needs read access to the dataset holding your billing export (BigQuery Data Viewer on that dataset); bigquery.jobs.create to run any query (BigQuery Job User has it).
SELECT
service.description AS service,
sku.description AS sku,
sku.id AS sku_id,
ROUND(SUM(cost), 2) AS cost,
-- Committed-use and sustained-use discounts arrive as credits, not as a
-- lower cost, so the rate that shows them is the one after credits.
ROUND(SUM(cost)
+ SUM(IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) c), 0)), 2) AS net_cost,
SUM(usage.amount_in_pricing_units) AS usage_amount,
ANY_VALUE(usage.pricing_unit) AS pricing_unit,
ROUND(SAFE_DIVIDE(
SUM(cost) + SUM(IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) c), 0)),
SUM(usage.amount_in_pricing_units)), 6) AS effective_unit_rate
FROM `PROJECT.DATASET.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
WHERE _PARTITIONTIME >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 35 DAY)
AND cost > 0
GROUP BY service, sku, sku_id
ORDER BY cost DESC
LIMIT 100;What it returns
- sku
- The SKU description, the words on your invoice. Paste it into the SKU dictionary.
- sku_id
- The stable SKU identifier, for matching the same SKU across exports.
- net_cost
- Cost after credits: what the SKU really cost once discounts applied.
- effective_unit_rate
- Net cost ÷ usage. Compare against list price to see your real discount.
How to read it
- SKU descriptions are the language your bill is actually written in. Learning the top 20 for your estate is the highest-leverage hour a new FinOps hire can spend.
- A rising effective_unit_rate on flat usage means a discount lapsed or you crossed a tier boundary the wrong way. It is worked out after credits, because that is where committed-use and sustained-use discounts appear.
- Egress SKUs are named by lane ("from Americas to China"), so the same logical action appears under many SKUs. Aggregate them before drawing conclusions.
Take it further
Run this once, or have it run every day.
Finitizer evaluates this class of question continuously against your live BigQuery estate, tracks how each number moves between runs, and turns findings into assigned tasks. Read-only and keyless.
See how Finitizer works