ecem.fyi
Back to blogData Engineering

Controlling BigQuery Costs on the GA4 Raw Export

·8 min read

The raw GA4 export lands one table per day, nested and repeated to the point that a naive SELECT * over a month of data can scan more bytes than the rest of your warehouse combined.

Start with partition and cluster pruning

query.sqlBigQuery parsed
✓ no problems·5 lines·returns event_name, events
Checked in-browser for syntax only — run it in the BigQuery console to get results.

Filtering on _TABLE_SUFFIX instead of a derived date column is the single biggest cost lever available on this dataset — it decides which daily tables even get scanned.

Materialize the flattened views you actually query

Most dashboards need three or four denormalized event tables (sessions, ecommerce items, conversions), not the raw nested export. A scheduled query that flattens event_params and items once a day turns a multi-terabyte scan into a multi-gigabyte one for every query after it.