BigQuery costs explained: bytes billed, partition pruning, clustering and slot editions
A BigQuery query is billed by the logical bytes of the columns it reads in the partitions it cannot skip. This guide measures that number on a sample table, then cuts one dashboard query from about 1,200 TiB a month to under 300 TiB.
- Reading time
- 17 min
- Sections
- 9
- Code examples
- 6
- Tables
- 5
- Sources
- 8
- Published
- 24 Nov 2026
- What changed
- Project caps for reservations become generally available
- Why it matters
- The biggest BigQuery savings come from habits, not contracts.
- What to do
- Measure before tuning
BigQuery has no warehouse to size and no cluster to start. You write SQL and Google runs it. That simplicity hides the one number that decides your bill on the on-demand model: bytes billed. Every query is charged for the bytes it reads, and those bytes depend on three choices you make long before the query runs: which columns you select, how the table is partitioned, and how it is clustered.
This article teaches that number from the ground up. We compute bytes billed for a sample table using Google's published per-type sizes, apply each technique in turn, and finish with cost guards, the query cache, and the arithmetic that tells you when paying per slot beats paying per byte. Prices are the default list prices on Google's pricing page in November 2026; check your region and contract.
What happened
BigQuery's pricing model has been stable for some time, but the controls around it keep growing. Two recent changes matter for cost work.
Project caps for reservations become generally available (11 November 2026)
Google's release notes record that project caps, also called scheduling policies, are now generally available in the Enterprise and Enterprise Plus editions. A cap limits the maximum slots and the concurrency one project can use inside a shared reservation, so one team's runaway backfill cannot starve everyone else.
Compute cost attribution for editions enters preview (9 November 2026)
The same notes list an opt-in preview that charges compute to the query projects that use an administration project's reservation. Before this, the central team that bought the slots carried the whole bill; attribution makes chargeback by team possible without building it from job metadata.
Neither change alters how a single query is billed. That is what the rest of this article explains.
How BigQuery decides the bytes a query is billed for
BigQuery stores tables in columns, not rows. Think of a library where each book is shelved by chapter instead of by title: if you only need chapter three of every book, you walk one aisle, not the whole building. A query that names three columns reads three aisles.
On the on-demand model, the bill follows in four steps.
- Find the referenced columns. Every column in
SELECT,WHERE,JOIN,GROUP BYandORDER BYcounts.SELECT *references all of them. - Find the storage that must be scanned. Partition filters remove whole partitions. Cluster filters can remove blocks inside the remaining partitions.
- Add up the logical size of those columns in what remains. Logical size is not the compressed size on disk. Google's data type sizes table sets
INT64,FLOAT64,DATE,DATETIMEandTIMESTAMPat 8 logical bytes,BOOLat 1,NUMERICat 16, and aSTRINGat 2 bytes plus its UTF-8 length. - Apply minimums and price. Charges round up to the nearest MB, with a minimum of 10 MB per table referenced and 10 MB per query. The on-demand price is $6.25 per TiB, and the first 1 TiB each month is free.
One consequence surprises many people: LIMIT does not save money on an ordinary table. The docs state that applying LIMIT "doesn't affect the amount of data that is read". Clustered tables are the exception, where a LIMIT can reduce the bytes scanned.
Measuring it on a sample table
Because the rules are arithmetic, we can compute bytes billed exactly. The script below builds 300,000 synthetic click events over 30 days in DuckDB and sums the BigQuery logical size of each column. It runs as is after pip install duckdb; one thread keeps the random data reproducible.
import duckdb
con = duckdb.connect()
con.execute("SET threads=1")
con.execute("SELECT setseed(0.42)")
con.execute("""
CREATE TABLE events AS
SELECT
TIMESTAMP '2026-10-01' + to_seconds(CAST(floor(random()*86400*30) AS BIGINT)) AS event_ts,
CAST(floor(random()*50000) AS BIGINT) AS user_id,
(['TR','US','DE','GB','FR','NL','IN','BR'])[1+CAST(floor(random()*8) AS INT)] AS country,
(['page_view','add_to_cart','checkout','search','login'])[1+CAST(floor(random()*5) AS INT)] AS event_name,
repeat('x', 200 + CAST(floor(random()*400) AS INT)) AS payload
FROM range(300000)
""")
# BigQuery logical sizes: TIMESTAMP 8, INT64 8, STRING 2 + UTF-8 length
size = {"event_ts": "8", "user_id": "8", "country": "2+strlen(country)",
"event_name": "2+strlen(event_name)", "payload": "2+strlen(payload)"}
def billed(cols, where="TRUE"):
expr = " + ".join(f"SUM({size[c]})" for c in cols)
return con.execute(f"SELECT {expr} FROM events WHERE {where}").fetchall()[0][0]
full = billed(list(size))
three = ["event_ts", "country", "event_name"]
week = "event_ts >= TIMESTAMP '2026-10-24' AND event_ts < TIMESTAMP '2026-10-31'"
print(full, billed(three), billed(three, week))
The output, with each scenario's share of the full table:
| Scenario | Logical bytes | Share of table |
|---|---|---|
A. SELECT *, no filter |
129,522,217 | 100% |
| B. Three columns, no partitioning | 6,542,612 | 5.05% |
| C. Three columns, 7 of 30 daily partitions | 1,529,151 | 1.18% |
The per-column split explains the gap. The payload string is 93.1% of the table; the timestamp and user ID are 1.9% each, event_name 2.3%, and the two-letter country code 0.9%. At this toy size every query would still bill the 10 MB minimum, which is a lesson in itself: tiny tables cost the same tuned or not. The savings appear at scale.
Scaling the same shape to a real table
Give the table the same shape at 4 TiB (4,096 GiB of logical data) and imagine one dashboard query: events per type for one country over the last seven days. Ten tiles across twenty analysts run it 6,000 times a month.
| Scenario | GiB per run | TiB per month | On-demand cost per month |
|---|---|---|---|
A. SELECT *, no filter |
4,096.0 | 24,000.0 | $149,993.75 |
| B. Three columns, no partitioning | 206.9 | 1,212.3 | $7,570.77 |
| C. Three columns, partitioned by day | 48.4 | 283.3 | $1,764.66 |
Monthly cost is TiB per month, minus the free 1 TiB, times $6.25. Naming columns cut the bill by a factor of about 20; one partition filter cut it by another factor of about 4.3.
Partitioning: removing whole slices before the scan
A partition is a physical slice of a table. BigQuery offers three kinds:
| Type | Partition key | Granularity | Typical use |
|---|---|---|---|
| Time-unit column | A DATE, TIMESTAMP or DATETIME column |
Hourly, daily (default), monthly or yearly; DATE has no hourly option |
Events, orders, logs |
| Ingestion time | Arrival time, exposed as _PARTITIONTIME and _PARTITIONDATE |
Same as above | Landing tables without a reliable event time |
| Integer range | An INT64 column with start, end and interval |
Fixed integer buckets | Customer or tenant ID ranges |
A table can hold at most 10,000 partitions. Rows with a NULL key land in a __NULL__ partition and out-of-range values in __UNPARTITIONED__, so check those two before you trust a filter.
Here is the events table with daily partitions, clustering and two safety options:
CREATE TABLE analytics.events
(
event_ts TIMESTAMP NOT NULL,
user_id INT64,
country STRING,
event_name STRING,
payload STRING
)
PARTITION BY DATE(event_ts)
CLUSTER BY country, event_name
OPTIONS (
require_partition_filter = TRUE,
partition_expiration_days = 400
);
require_partition_filter makes BigQuery reject any query without a usable filter on the partition column, with the error "Cannot query over table ... without a filter that can be used for partition elimination". It also applies to views over the table. partition_expiration_days drops whole partitions once they pass the age you set, which is cheaper and safer than a nightly DELETE.
Which filters actually prune
Pruning is decided before the query runs, so the filter must be something BigQuery can evaluate up front:
| Filter | Prunes? | Why |
|---|---|---|
event_ts >= '2026-11-01' AND event_ts < '2026-11-08' |
Yes | Constant range on the bare column |
DATE(event_ts) = '2026-11-20' |
Yes | DATE() is a supported wrapper |
TIMESTAMP_TRUNC(event_ts, MONTH) >= '2026-09-01' |
Yes | Supported truncation with constants |
event_ts + INTERVAL 1 DAY > '2026-11-20' |
No | Arithmetic on the column hides it |
EXTRACT(MONTH FROM event_ts) = 11 |
No | EXTRACT is not a supported pruning function |
DATE(event_ts) = (SELECT MAX(d) FROM ops.load_log) |
No | A subquery is dynamic, so it cannot limit the scan |
DATE(event_ts) = '2026-11-20' OR country = 'TR' |
No | OR with another column defeats elimination |
The subquery row catches people most. A common "load the latest partition" pattern reads the date from a control table, and BigQuery then scans every partition. Compute the date first, in a script variable or your orchestrator, and pass it as a literal or query parameter. The same idea underpins idempotent batch jobs with explicit data intervals.
When not to partition
Partitioning adds metadata. Google advises considering clustering instead when partitions would hold roughly under 10 GB each, because many small partitions slow metadata access. A table growing 200 MB a day is better monthly-partitioned or clustered-only. Hourly granularity suits high-volume data over a short span, typically under six months.
Clustering: skipping blocks inside what remains
Clustering sorts the data inside each partition by up to four columns, in the order you list them, and BigQuery skips storage blocks whose values cannot match a filter on those columns. It is the same idea as the min and max statistics inside a Parquet row group.
Order matters. With CLUSTER BY country, event_name, a filter on country prunes well, a filter on both prunes better, and a filter on event_name alone gets little help, because data is only sorted by event_name within each country. Three more points from the docs:
- Reclustering is automatic and free. BigQuery re-sorts new rows in the background and lists this as a free operation with no effect on query capacity.
- Small tables gain little. Tables or partitions over 64 MB are likely to benefit; below that the gain is usually negligible.
- The cost is only known afterwards. The blocks to scan are not known until execution, so a dry run returns an upper bound.
In our example, Turkey is 12.55% of the rows in the seven-day window. If every Turkish row sat in blocks of its own, scenario C would fall from 48.4 GiB to about 6.1 GiB per run, roughly $216 a month instead of $1,765. Blocks at the edges hold mixed values, so the real figure lands somewhat above that floor; measure it from job statistics after a day of use.
Partition or cluster: a decision table
| Situation | Choose |
|---|---|
| Date-range filters and partitions averaging 10 GB or more | Partition by date, then cluster |
| You need a firm cost estimate before running | Partition (dry runs show exact pruning) |
| Filters on several columns or a high-cardinality key | Cluster on those columns |
| More than 10,000 partitions needed | Coarser partitions plus clustering |
| DML touches most partitions often | Cluster only |
| Old data should get long-term storage pricing | Partition, so untouched partitions qualify one by one |
Guards, cache and the cost of habits
Good table design can be undone by one careless query. Four guards are worth turning on.
Dry runs report the bytes a query would process without running it:
bq query --use_legacy_sql=false --dry_run \
'SELECT event_name, COUNT(*) FROM analytics.events
WHERE event_ts >= "2026-11-17" AND event_ts < "2026-11-24" AND country = "TR"
GROUP BY event_name'
Pruned partitions are not counted, so comparing estimates with and without the date filter shows whether pruning works. On tables with row-level security, dry runs always return 0 bytes to prevent side-channel attacks.
Maximum bytes billed sets a ceiling per query: if the estimate exceeds it, the query fails without a charge. Clustered estimates are upper bounds, so leave headroom.
bq query --use_legacy_sql=false --maximum_bytes_billed=60000000000 '...'
Custom quotas cap the data processed per day per project or per user; once reached, that user cannot run more queries that day. Table preview shows sample rows free of charge and without affecting quotas, unlike SELECT * ... LIMIT 10.
The query cache, and why dashboards often miss it
BigQuery keeps query results for about 24 hours, per user and per project, and a cache hit is not billed. Dashboards often miss it for one reason: the cache is skipped when a query uses a non-deterministic function such as CURRENT_DATE() or CURRENT_TIMESTAMP().
A "last seven days" tile usually writes WHERE event_ts >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY), so every refresh is a full billed query. If the BI tool sends dates as literals or parameters, repeat runs by the same user within the day can hit the cache. The cache is also skipped when query text changes at all, even whitespace, when a destination table is set, or when the table has changed. Cross-user reuse inside a project needs Enterprise or Enterprise Plus. Semantic layers help, because they generate the same SQL for the same question; see how semantic layers generate measures and joins.
Finding the expensive queries
The INFORMATION_SCHEMA.JOBS view holds the history. This query ranks users by billed bytes and slot time over 30 days:
SELECT
user_email,
COUNT(*) AS jobs,
ROUND(SUM(total_bytes_billed) / POW(1024, 4), 2) AS tib_billed,
ROUND(SUM(total_slot_ms) / 1000 / 3600, 1) AS slot_hours,
COUNTIF(cache_hit) AS cache_hits
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
AND job_type = 'QUERY'
AND statement_type != 'SCRIPT'
GROUP BY user_email
ORDER BY tib_billed DESC;
Excluding SCRIPT rows avoids counting a multi-statement script twice, once as the parent and once as its children.
Continue learning
How this article connects
8 pages link to or from it. Drag to turn, click a dot to open it.
- Query and processing engines: Spark, DuckDB, Trino, ClickHouse and wareh
- DuckDB
- Google BigQuery
- Inside a Parquet file: row groups, pages, encodings, statistics and comp
- dbt incremental models explained: merge, delete+insert, microbatch and s
- Idempotent batch jobs: partition overwrites, data intervals and safe bac
- How semantic layers stop fan-out: measures, entities and join paths, tes
- Snowflake virtual warehouses and credits: sizing, auto-suspend and multi
On-demand or slot editions: the break-even
The alternative to paying per byte is paying for compute time in slots. A slot is a unit of processing capacity, a little like a kitchen worker: more workers cook faster, and you pay for their hours at the stove whether they cook or not.
The pricing page lists default pay-as-you-go rates per slot-hour of $0.04 for Standard, $0.06 for Enterprise and $0.10 for Enterprise Plus, with lower rates for one- and three-year commitments sold in steps of 50 slots. Autoscaling bills per second with a one-minute minimum by default; opt-in fluid scaling bills per second with no minimum. Rates vary by region.
The break-even is simple division. One TiB on demand costs $6.25, which buys 104.2 Enterprise slot-hours. If your queries use fewer than about 104 slot-hours per TiB they scan, slots are cheaper; above that, on-demand wins. The same sum gives 156.3 for Standard and 62.5 for Enterprise Plus.
Take scenario C. Suppose INFORMATION_SCHEMA.JOBS shows each run billing 48.4 GiB and using 3,600,000 total_slot_ms, one slot-hour. That is about 21 slot-hours per TiB, far below 104: on demand a run costs $0.30, on Enterprise slots about $0.06, if autoscaling tracks the work closely. Scan-heavy, simple queries favour slots; CPU-heavy queries over little data favour on-demand.
Two cautions. Baseline slots bill around the clock, and autoscaled slots carry the one-minute minimum unless you opt into fluid scaling, so idle capacity erodes the saving. And the edition gates features: project caps and cross-user caching need Enterprise or higher. The same reasoning applies to Snowflake; compare Snowflake warehouse sizing and auto-suspend and try the warehouse sizing simulation.
Storage: the quieter half of the bill
Storage is billed per GiB, by default on logical bytes. The pricing page's hourly rates work out to roughly $0.023 per GiB-month for active logical storage and $0.016 for long-term. Long-term pricing applies automatically to any table or partition unmodified for 90 consecutive days. On a 1 TiB table where three quarters of the partitions are old and untouched, storage falls from about $23.55 to $18.18 a month. A job that rewrites the whole table nightly resets every partition to active pricing. Physical billing charges compressed bytes at higher rates and also bills time travel and fail-safe storage, so it pays off only when data compresses well.
What it means in practice
The biggest BigQuery savings come from habits, not contracts. Naming columns cut our example about twentyfold; a date partition with a constant filter cut it about fourfold more. Clustering trims what is left, but only measurement shows how much.
The dangerous queries look harmless: a tile with CURRENT_TIMESTAMP(), a "latest partition" lookup through a subquery, or LIMIT 10 as a preview. Each defeats a mechanism you thought was protecting you. Switching to slot editions is a second-stage decision made from job history, using slot-hours per TiB. For the wider picture, see query and processing engines and the BigQuery tool page.
What to do now
- Measure before tuning. Run the
INFORMATION_SCHEMA.JOBSquery and list the 20 queries with the most billed bytes. - Ban
SELECT *in scheduled jobs. Wide text columns are usually most of the bill. - Partition large event tables by date. Daily when partitions average 10 GB or more; monthly or clustering otherwise.
- Turn on
require_partition_filter. A missing filter then fails fast instead of scanning everything. - Replace dynamic partition filters. Compute "latest date" in the orchestrator and pass it as a literal or parameter.
- Cluster on common filters. Up to four columns, in the order analysts filter.
- Set a maximum bytes billed default. Apply it to BI connections and service accounts, with headroom.
- Make dashboard SQL cacheable. Send dates as parameters instead of
CURRENT_DATE(). - Compute your slot break-even. Divide slot-hours by TiB billed; below about 104 for Enterprise, test a reservation.
- Stop rewriting old partitions. Incremental loads let untouched partitions reach long-term pricing; dbt incremental models make this routine.
Risks and open questions
Estimates mislead in both directions. Dry runs are exact for partition pruning, upper bounds for clustering, and zero on tables with row-level security. Use them as guards, not accounting.
Clustering quality varies. Heavy streaming and frequent DML change how well sorted blocks are at any moment, so track bytes billed per query over time.
Slot savings depend on utilisation. A reservation sized for the Monday peak can cost more than on-demand in a quiet week.
Prices and features vary. These are default list prices; region, currency and discounts differ, and several controls require Enterprise or Enterprise Plus.
Watch next: whether the compute cost attribution preview replaces home-grown chargeback queries, and how project caps change the way teams share one large reservation.
Frequently asked questions
Does LIMIT reduce the cost of a BigQuery query?
On an ordinary table, no. Google's docs say LIMIT does not affect the amount of data read, so SELECT * FROM t LIMIT 10 bills a full scan of every column. On a clustered table a LIMIT can reduce the bytes scanned, and the table preview is free.
How is the size of a STRING column counted?
Each STRING value counts as 2 logical bytes plus its UTF-8 length. A two-letter country code is 4 bytes and a 500-character JSON payload is 502 bytes, while INT64 and TIMESTAMP values are 8 bytes each. That is why long text columns usually dominate the bill.
Why does my partitioned table still scan every partition?
The filter is probably not one BigQuery can evaluate before the query runs. Subqueries, arithmetic on the partition column, unsupported functions such as EXTRACT, and OR with other columns all prevent pruning. Rewrite it as a constant range on the bare column and confirm with a dry run.
Are cached query results free?
Yes. Results are kept for about 24 hours per user and per project, and a cache hit is not billed, though it counts against quotas. The cache is skipped for non-deterministic functions, changed query text, destination tables, or tables changed since.
When should I move from on-demand to an edition?
Divide the slot-hours your queries use by the TiB they bill, from INFORMATION_SCHEMA.JOBS. At the default Enterprise rate of $0.06 per slot-hour, break-even is about 104 slot-hours per TiB; below that, slots are cheaper. Allow for idle baseline slots and the autoscaling minimum.
Summary
BigQuery's on-demand bill is the logical size of the columns a query references, in the partitions and blocks it cannot skip, at $6.25 per TiB after a free 1 TiB a month. Naming columns and partitioning by date with constant filters cut a sample dashboard query from about 1,212 TiB to 283 TiB a month before clustering trimmed it further. Guards such as require_partition_filter, maximum bytes billed and daily quotas stop accidents, and cache-friendly SQL makes repeat refreshes free. Move to slot editions only when job history shows a low slot-hours per TiB ratio, and leave old partitions alone so they reach long-term storage pricing.
Sources
- Docs Google Cloud: BigQuery pricing
- Docs Google Cloud: Introduction to partitioned tables
- Docs Google Cloud: Query partitioned tables
- Docs Google Cloud: Introduction to clustered tables
- Docs Google Cloud: Estimate and control costs
- Docs Google Cloud: Use cached query results
- Docs Google Cloud: GoogleSQL data types
- Docs Google Cloud: BigQuery release notes
Cite this article
Kelahmet, Ö. C. (2026, November 24). BigQuery costs explained: bytes billed, partition pruning, clustering and slot editions. Özer Cem KELAHMET. https://www.ozercemkelahmet.com/articles/bigquery-bytes-billed-partitioning-clustering
BibTeX
@online{kelahmet2026bigquery,
author = {Kelahmet, {\"O}zer Cem},
title = {{BigQuery costs explained: bytes billed, partition pruning, clustering and slot editions}},
year = {2026},
month = {nov},
url = {https://www.ozercemkelahmet.com/articles/bigquery-bytes-billed-partitioning-clustering}
}Version historyfirst version
- Published
Factual corrections are listed here with what changed. Wording and formatting edits are not listed.