Optimizing BigQuery: How a Pipeline Audit Cut Costs by 75% at Huckberry


Cloud data warehouses make scaling effortless, but without strict pipeline governance, minor technical inefficiencies quickly compound into massive monthly spend. During a recent data architecture audit for outdoor retailer Huckberry, an examination of historical BigQuery execution logs revealed a classic optimization trap: high-frequency execution running on completely static data.

The Problem: Redundant Execution and Idle Compute

The audit uncovered a heavy SQL query scheduled to run every single hour, 24 times a day. While high-frequency jobs make sense for real-time operational dashboards, an inspection of the underlying data infrastructure revealed two primary issues:

  • Stagnant Source Data: Upstream source tables were only being refreshed once per day overnight. Running the downstream pipeline hourly meant 23 out of 24 daily runs were reprocessing identical data, generating zero new business insights.
  • Unoptimized SQL Syntax: The underlying query relied on full table scans and nested subqueries, maximizing the total bytes processed by BigQuery on every execution.

Every hour, the pipeline scanned massive volumes of static data, driving up BigQuery compute charges for completely redundant output.

The Solution: Technical Refactoring and SLA Realignment

Resolving the issue required addressing both the query syntax and the underlying business requirements.

  • Query Refactoring: Reconstructed the SQL logic to minimize bytes scanned. Replaced inefficient subqueries with targeted joins, leveraged existing table partitioning and clustering keys, and eliminated unnecessary full-table scans.
  • Stakeholder Alignment: Worked directly with downstream data consumers and analytics teams to evaluate true SLA requirements. Because the underlying source data updated once per day, stakeholders agreed that shifting from an hourly schedule to a single daily run after the overnight ingest fully satisfied their reporting needs.

The Impact

  • >75% Reduction in BigQuery Costs: Combining query optimization with a daily schedule reduced execution frequency from 24 runs to 1 run per day, significantly dropping bytes processed per run.
  • Zero Business Interruption: Downstream dashboards remained accurate without consuming unnecessary compute budget.
  • Pipeline Governance: Established execution monitoring patterns to identify redundant scheduled queries across other warehouse pipelines.

Routine data pipeline audits remain one of the highest-ROI initiatives in modern cloud data engineering. Aligning job schedules with actual source data update rhythms keeps cloud spend lean without sacrificing analytical utility.