Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 37 ยท Security and Cost

Pricing: On-Demand and Editions

Understand how BigQuery charges for queries and storage: on-demand bytes scanned, capacity editions with slots, logical vs physical storage, and break-even maths.

BigQuery separates storage from compute, and each has its own price. Understanding the two compute models, on-demand and capacity (editions), lets you predict a bill and choose the cheaper one for your workload. A surprising bill almost always comes from not knowing which model a project uses, or from one query that scanned far more bytes than anyone expected.

Prices change and differ by region, so this lesson uses example rates for explanation only. Always check the current pricing page for your region before budgeting. The arithmetic in the runnable examples uses those example rates, and the formulas stay the same when the numbers change.

Compute: on-demand pricing

With on-demand pricing you pay for the number of bytes your queries process. Rules to remember:

  • The unit is a tebibyte (TiB) of data processed; a recent US rate is around 6.25 USD per TiB.
  • The first 1 TiB of query processing per month is free, per billing account.
  • Only the columns you select are read. Columns store separately, so SELECT * reads (and bills) every column.
  • Each table a query references is billed at least 10 MB.
  • Failed queries and queries answered from the cache are not charged.
  • Charges depend on bytes read, not rows returned, so LIMIT does not reduce them on most tables.
  • BigQuery makes the compute available in a shared slot pool; you do not choose a size.

On-demand is ideal for light or unpredictable use: no commitment and no idle cost.

Compute: capacity pricing with editions

With BigQuery editions (Standard, Enterprise, Enterprise Plus) you pay for slots, units of compute, measured in slot-hours, instead of bytes. You can:

  • use autoscaling, where you set a maximum and pay only for the slots used, billed per second with a one-minute minimum;
  • add commitments (one or three years) for a lower slot-hour rate;
  • split capacity across teams with reservations and assignments: a reservation is a pool of slots, and an assignment attaches a project, folder or organization to it.

Higher editions add features: Standard has the basics, Enterprise adds security and governance features such as column-level security and BigQuery ML support for more model types, and Enterprise Plus adds the strongest availability and compliance options. Compare the current feature table before choosing.

flowchart LR
  Q["Queries"] --> M{"Pricing model"}
  M -->|On-demand| B["Pay per TiB scanned"]
  M -->|Editions| S["Pay per slot-hour"]
  S --> A["Autoscale"]
  S --> C["Commitment (1 or 3 years)"]

One project uses one model at a time, but different projects in an organization can use different ones.

Which is cheaper? A break-even calculation

On-demand cost grows with bytes; capacity cost grows with slot time. The example computes both for a month of workload. The per-TiB rate and per-slot-hour rate are explanatory examples, not quotes.

SQL On-demand versus slots, month by month

Press Run (or Ctrl + Enter) to see the result here.

For small months on-demand wins; when sustained usage is heavy, slots win because they cap the cost of scanning large tables repeatedly. Real decisions also weigh predictability: a fixed slot budget cannot surprise you the way a runaway on-demand query can.

Storage pricing

Storage has two billing models per dataset:

  • Logical storage bills the uncompressed size of your data, with active (modified in the last 90 days) and long-term (untouched for 90 days, around half price) rates.
  • Physical storage bills the compressed bytes on disk, including time-travel and fail-safe copies, at a higher per-GiB rate. It often costs less overall for highly compressible data, such as repetitive logs.

Switch a dataset with ALTER SCHEMA ... SET OPTIONS (storage_billing_model = 'PHYSICAL'). The first 10 GiB per month are free. Loading data into BigQuery (batch loads from Cloud Storage) is free of query charges; streaming inserts and the Storage Read API have their own prices. Partition expiration and table expiration remove storage you no longer need.

Python Logical or physical storage?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Highly compressible data benefits from physical billing, while poorly compressible data does not. Estimate with real figures from INFORMATION_SCHEMA.TABLE_STORAGE, which reports both logical and physical bytes per table.

Other charges to know about

  • Streaming: the Storage Write API has a per-GiB ingestion price with a free allowance.
  • BigQuery ML training and some model types are billed differently from normal queries.
  • BI Engine reservations speed up dashboards by caching in memory.
  • Egress when data leaves Google Cloud to another region or the internet.
  • Cross-region queries and copies follow network pricing.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. On the on-demand model, what do you pay for?

    On-demand queries are billed by bytes read from the columns referenced.
  2. 2. What is a slot?

    Slots are units of compute (CPU, memory, I/O); editions bill slot-hours.
  3. 3. Which workload usually favors capacity (editions) pricing?

    Sustained heavy scanning makes a fixed slot budget cheaper and more predictable than per-TiB charges.
  4. 4. After about how long untouched does a table get the cheaper long-term storage rate?

    Tables or partitions not modified for 90 consecutive days move to long-term logical storage pricing.

Summary

  • On-demand bills bytes read per query (with a free monthly tier); editions bill slot-hours with autoscaling and commitments.
  • Only the columns you read count, so avoid SELECT *; LIMIT does not reduce bytes.
  • Compare on-demand and slot costs from real usage; steady heavy use favors slots.
  • Storage is billed logically or physically, with active and long-term rates.
  • Always check current regional prices; the rates here are examples.

Next: Controlling Query Cost