← All writing

Five BigQuery cost anti-patterns I keep finding in production

Every BigQuery bill I’ve audited had at least three of these. None of them are exotic — they’re the default behavior of reasonable people using a tool that charges by bytes scanned.

1. SELECT * on wide tables

BigQuery is columnar: you pay for every column you touch, not every row. SELECT * on a 200-column events table scans all 200 columns to feed a dashboard that renders six of them.

The fix: name your columns. For exploration, use the preview tab — it’s free.

2. Filtering on a partition column… after transforming it

A table partitioned by event_date gives you cheap time-bounded scans — unless the query says WHERE DATE_TRUNC(event_date, MONTH) = '2026-06-01'. Wrap the partition column in a function and BigQuery can often no longer prune partitions; it scans everything.

The fix: keep the partition column bare: WHERE event_date BETWEEN '2026-06-01' AND '2026-06-30'.

3. Materializing what should be a view (and vice versa)

Teams schedule full-table rebuilds of derived tables that are queried twice a week, while their most-hit transformation runs as a view recomputed on every dashboard refresh. Both directions waste money.

The fix: query frequency decides. Hot paths get materialized (incrementally if possible); cold paths stay views.

4. Unbounded historical scans in scheduled queries

A scheduled query that recomputes “all-time” metrics every hour scans the full history 24 times a day. The history didn’t change — only yesterday did.

The fix: make scheduled work incremental. Process the new partition, merge into the aggregate.

5. Dev queries against production-size data

Analysts iterating on a query run it end-to-end a dozen times before it’s right. Each iteration scans the full table.

The fix: iterate on a TABLESAMPLE or a pinned dev dataset, then run the real thing once. And set per-user custom cost controls — maximum_bytes_billed turns a five-figure mistake into an error message.


The common thread: BigQuery’s pricing model rewards knowing what you’re scanning. A one-day audit of your top 50 queries by bytes billed usually pays for itself in the first month. That audit is exactly the kind of thing I do — get in touch if your bill has been creeping.