Skip to content
Finitizer

What CREATE MODEL costs in BigQuery

Training a regression, k-means, PCA or time series model costs 50 times the query price, and auto-ARIMA multiplies it again.

Check one of your own queries for this

Paste a query and the calculator estimates what it scans and flags the patterns it can detect statically. It runs in your browser.

What it is

CREATE MODEL in BigQuery ML reads its training query like any other, but those bytes are not priced like a query. The model type sets the price, so the same SELECT can cost 50 times as much inside CREATE MODEL as it does on its own.

Why it costs money

  • Linear and logistic regression, k-means, PCA, time series and contribution analysis cost $312.50 per TiB in the US, against $6.25 for a query. It is 50 times in every location.
  • Auto-ARIMA fits candidate models and charges the bytes once for each. At the default AUTO_ARIMA_MAX_ORDER of 2, several series cost 12 candidates. One series costs 6 or 12, depending on the data.
  • AutoML, DNN, wide-and-deep, boosted tree, random forest and autoencoder models bill the bytes at the query price, then add a training cost passed through from Google's AI platform. Bytes do not predict that part.
  • Google counts evaluation, inspection and prediction in the free 1 TiB. It does not list model creation there, and each CREATE OR REPLACE MODEL bills again in full.

Worked example

Expensive
CREATE MODEL `shop.churn`
OPTIONS (model_type = 'logistic_reg') AS
SELECT * FROM `shop.events`
Cheaper
CREATE MODEL `shop.churn`
OPTIONS (model_type = 'logistic_reg') AS
SELECT churned, visits, spend
FROM `shop.events` TABLESAMPLE SYSTEM (10 PERCENT)
The arithmetic. At 100 GiB the training query is 0.0977 TiB × $312.50 = $30.52 a run. The same SELECT alone costs $0.61. As ARIMA_PLUS on several series at the default order, the 100 GiB costs $366.21.

How to fix it

  1. 1Select only the columns the model uses. SELECT * pays the training price on every column.
  2. 2Train on a partition range or a TABLESAMPLE, then widen it if the model needs more data.
  3. 3For ARIMA, keep AUTO_ARIMA_MAX_ORDER low, or set AUTO_ARIMA to FALSE with NON_SEASONAL_ORDER on one series.
  4. 4Retrain on a schedule that matches how fast the data changes.
The calculator detects this one. Paste your query into the BigQuery Query Cost Calculator and it will point at the exact line.

Fixing one query is satisfying. Fixing the pattern is the win.

Finitizer finds every instance of this across your BigQuery job history, ranks them by what they actually cost, and keeps checking after you have fixed them.

See how Finitizer works