guide5 min read

Cost Agent Bigquery Slots Rightsizing

Cost Agent Bigquery Slots Rightsizing

Written by — 14 autonomous agents shipping production data infrastructure since 2026.

Technically reviewed by the Data Workers engineering team.

Last updated .

Data Workers' Cost Agent analyzes BigQuery slot utilization and recommends optimal reservation configurations that balance query performance against cost — helping teams avoid both the waste of over-provisioned slots and the throttling of under-provisioned ones. BigQuery's slot-based compute model offers predictable pricing through reservations, but rightsizing those reservations requires continuous analysis of workload patterns that most teams lack the tooling to perform.

This guide covers the Cost Agent's BigQuery slot analysis methodology, reservation optimization strategies, the on-demand versus reserved pricing decision framework, and monitoring patterns for maintaining optimal slot allocation as workloads evolve.

Understanding BigQuery Slot Economics

BigQuery offers two pricing models: on-demand (per-TB scanned) and reservations (flat-rate slots). On-demand is simpler but unpredictable — a single poorly written query can scan petabytes and generate a massive bill. Reservations provide cost predictability but require capacity planning: too few slots and queries queue, too many and you pay for idle compute.

The Cost Agent helps teams navigate this tradeoff by analyzing historical query patterns and modeling the cost under both pricing options. For many organizations, the optimal strategy is a hybrid: base load on reservations with on-demand flex for burst workloads. The agent identifies the optimal split point based on your specific workload profile.

Pricing ModelBest ForRiskCost Agent Value
On-demandVariable workloads, small teamsUnpredictable bills from expensive queriesIdentifies queries to optimize or migrate to reservations
Flat-rate reservationsPredictable high-volume workloadsPaying for idle slots during off-peakRight-sizes reservations based on utilization patterns
Flex slots (short-term)Burst workloads, batch processingAvailability not guaranteedRecommends flex slot windows based on workload timing
AutoscalingVariable workloads needing cost controlComplexity of baseline + autoscale configOptimizes baseline and max slot configuration
Editions (Standard/Enterprise)Feature-gated pricingFeature lock-inRecommends edition based on actual feature usage

Slot Utilization Analysis

The Cost Agent queries BigQuery's INFORMATION_SCHEMA.JOBS view and RESERVATION_CHANGES view to build a complete picture of slot utilization over time. It measures peak slots consumed, average utilization, slot wait time (queries queued because slots are exhausted), and slot waste (provisioned slots sitting idle). These metrics are decomposed by project, dataset, user, and time of day to identify specific optimization targets.

A common finding is extreme utilization variance: peak demand at 10x the average, concentrated in a 2-hour batch window. For these workloads, the agent recommends autoscaling reservations with a baseline set at the average and autoscaling headroom set to cover the peak. This approach reduces cost by 40-60% compared to flat reservations sized for peak.

  • Peak analysis — identifies maximum concurrent slot demand and its timing
  • Utilization curves — plots slot consumption by hour, day, and week to reveal patterns
  • Queue time tracking — measures how long queries wait for slots, indicating under-provisioning
  • Idle slot detection — calculates wasted capacity during low-utilization periods
  • Project attribution — breaks down slot consumption by GCP project for chargeback
  • Query classification — categorizes queries by type (ETL, BI, ad-hoc, ML) to size dedicated reservations per workload

Reservation Configuration Optimization

BigQuery reservations are organized hierarchically: organization, reservation, and assignment. The Cost Agent optimizes at each level. At the reservation level, it recommends the number of baseline slots and autoscaling limits. At the assignment level, it recommends which projects, folders, or organizations should be assigned to which reservations, based on workload isolation requirements and priority.

For organizations with multiple teams sharing BigQuery, the agent recommends a multi-reservation strategy: a shared reservation for low-priority batch work with best-effort scheduling, and dedicated reservations for high-priority interactive workloads with guaranteed slots. This ensures that BI dashboards remain responsive even during heavy batch processing, without over-provisioning total capacity.

On-Demand to Reserved Migration

Teams on on-demand pricing face a critical question: when is it cheaper to switch to reservations? The Cost Agent answers this by analyzing historical on-demand spending and modeling the equivalent reservation cost. The crossover point varies by workload, but typically teams spending more than $10,000 per month on BigQuery on-demand compute benefit from reservations.

The migration path is not all-or-nothing. The agent recommends a phased approach: start with flex slots for the predictable batch workload, keep ad-hoc queries on on-demand, and gradually shift workloads to reservations as utilization patterns become clearer. This approach minimizes risk while capturing immediate savings on the most predictable workloads.

Query-Level Cost Optimization

Regardless of pricing model, query optimization reduces BigQuery costs. The Cost Agent identifies the most expensive queries by bytes scanned and slot-time consumed, then recommends optimizations: replacing SELECT * with column selection, adding partition filters, using approximate aggregation functions, and restructuring queries to leverage BigQuery's columnar storage more effectively.

The agent also identifies queries that should be materialized. If the same expensive query runs daily with identical parameters, the agent recommends a scheduled query that materializes the result, with downstream consumers reading from the materialized table. This pattern can reduce scan volume by 90%+ for frequently-repeated analytical queries.

Continuous Monitoring and Alerts

BigQuery workloads evolve constantly as new use cases emerge and data volumes grow. The Cost Agent monitors slot utilization continuously and alerts when the current reservation configuration no longer matches the workload. It detects drift early — before queue times impact users or idle slots waste budget — and recommends adjustments.

For teams managing both BigQuery and Snowflake, the Cost Agent provides cross-platform cost visibility and optimization recommendations. Compare with Snowflake optimization strategies for a complete multi-cloud data warehouse cost management approach. Book a demo to see slot analysis on your BigQuery organization.

BigQuery slot rightsizing is a continuous optimization problem, not a one-time configuration. The Cost Agent analyzes utilization patterns, recommends reservation configurations, identifies query-level optimizations, and monitors for workload drift — ensuring BigQuery costs stay aligned with business value.

See Data Workers in action

15 autonomous AI agents working across your entire data stack. MCP-native, open-source, deployed in minutes.

Book a Demo

Related Resources

Explore Topic Clusters