Cost Agent Bigquery Slots Rightsizing
Cost Agent Bigquery Slots Rightsizing
Written by The Data Workers Team — 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 Model | Best For | Risk | Cost Agent Value |
|---|---|---|---|
| On-demand | Variable workloads, small teams | Unpredictable bills from expensive queries | Identifies queries to optimize or migrate to reservations |
| Flat-rate reservations | Predictable high-volume workloads | Paying for idle slots during off-peak | Right-sizes reservations based on utilization patterns |
| Flex slots (short-term) | Burst workloads, batch processing | Availability not guaranteed | Recommends flex slot windows based on workload timing |
| Autoscaling | Variable workloads needing cost control | Complexity of baseline + autoscale config | Optimizes baseline and max slot configuration |
| Editions (Standard/Enterprise) | Feature-gated pricing | Feature lock-in | Recommends 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.
Sources
See Data Workers in action
15 autonomous AI agents working across your entire data stack. MCP-native, open-source, deployed in minutes.
Book a DemoRelated Resources
- Claude Code + Cost Optimization Agent: Cut Your Snowflake Bill from the Terminal — Ask 'which tables are wasting money?' in Claude Code. The Cost Optimization Agent scans your warehouse, identifies zombie tables, oversiz…
- Cost Of Multi Agent Data Teams — Cost Of Multi Agent Data Teams
- Cost Agent Snowflake Optimization — Cost Agent Snowflake Optimization
- Why One AI Agent Isn't Enough: Coordinating Agent Swarms Across Your Data Stack — A single AI agent can handle one domain. But data engineering spans 10+ domains — quality, governance, pipelines, schema, streaming, cost…
- Why Every Data Team Needs an Agent Layer (Not Just Better Tooling) — The data stack has a tool for everything — catalogs, quality, orchestration, governance. What it lacks is a coordination layer. An agent…
- Why Your dbt Semantic Layer Needs an Agent Layer on Top — The dbt semantic layer is the best way to define metrics. But definitions alone don't prevent incidents or optimize queries. An agent lay…
- MCP Server for BigQuery: Give AI Agents Access to Your Analytics — BigQuery's MCP server gives AI agents access to schemas, query execution, and cost estimation. Here's how to connect it and use Data Work…
- Agent-Native Architecture: Why Bolting Agents onto Legacy Pipelines Fails — Bolting AI agents onto legacy data infrastructure amplifies problems. Agent-native architecture designs for autonomous operation from day…
- Multi-Agent Coordination Layers: Orchestrating AI Agents Across Your Data Stack — Multi-agent coordination layers manage handoffs, shared context, and conflict resolution across multiple AI agents.
- Database as Agent Memory: The Persistent Coordination Layer for Multi-Agent Systems — Databases are evolving from storage for human queries to persistent memory and coordination for multi-agent AI systems.
- Sub-Agents and Multi-Agent Teams for Data Engineering with Claude — Claude Code spawns sub-agents in parallel — one explores schemas, another writes SQL, another validates. Multi-agent data engineering.
- File-Based Agent Memory: Why Claude Code Agents Don't Need a Database — File-based agent memory is simpler, portable, and version-controlled. No database required.
Explore Topic Clusters
- Data Governance: The Complete Guide — Policies, access controls, PII, and compliance at scale.
- Data Catalog: The Complete Guide — Discovery, metadata, lineage, and the modern catalog stack.
- Data Lineage: The Complete Guide — Column-level lineage, impact analysis, and observability.
- Data Quality: The Complete Guide — Tests, SLAs, anomaly detection, and data reliability engineering.
- AI Data Engineering: The Complete Guide — LLMs, agents, and autonomous workflows across the data stack.
- MCP for Data: The Complete Guide — Model Context Protocol servers, tools, and agent integration.
- Data Mesh & Data Fabric: The Complete Guide — Federated ownership, domain-oriented architecture, and interop.
- Open-Source Data Stack: The Complete Guide — dbt, Airflow, Iceberg, DuckDB, and the modern OSS toolkit.
- AI for Data Infra — The complete category for AI agents built specifically for data engineering, data governance, and data infrastructure work.