Maintaining and automating data workloads · Topic 3 of 5

BigQuery Editions, Reservations and Query Priority

BigQuery capacity: on-demand or editions, baseline and autoscaling slots, commitments, reservations, assignments, idle slots, interactive or batch jobs.

  • 5 min
In a nutshell
  • On-demand bills bytes; editions bill slot-hours.
  • Standard, Enterprise and Enterprise Plus differ in features; commitments need Enterprise or higher.
  • Baseline slots are always on; autoscaling adds slots up to a maximum when needed.

What it is

BigQuery runs queries on slots, units of compute. Capacity management decides how you pay for slots (per byte on demand, or per slot with an edition) and how slots are divided between workloads so that critical jobs are never starved. Query priority decides whether a job runs now or waits in a queue.

WorkloadsETL, BI, ad hocPricing modelon demand or editionReservationsbaseline and autoscaleAssignmentsprojects, foldersPriorityinteractive or batch

How it works

On-demand or capacity pricing

ModelYou pay forFits
On-demandBytes processed per queryVariable or small usage; no capacity planning
Capacity (editions)Slot-hours, whatever the bytesHigh, steady usage; predictable cost; workload isolation

On-demand projects share a pool of slots with a per-project limit. Heavy concurrent usage can therefore queue, and cost grows with every byte scanned.

BigQuery editions

EditionPositioning
StandardEntry level: autoscaling slots, no capacity commitments, a reduced feature set
EnterpriseCommitments and baseline slots, plus the broad set of security, governance and analytics features most enterprises need
Enterprise PlusEnterprise features plus managed disaster recovery and compliance controls through Assured Workloads

Editions are chosen per reservation, so one organization can run Standard for development and Enterprise for production.

Reservations, baseline and autoscaling

TermMeaning
ReservationA named pool of slots in one location, created in an administration project
Baseline slotsAlways allocated to the reservation and billed continuously
AutoscalingAdds slots up to a maximum when demand rises; billed only while scaled up
CommitmentOne-year or three-year purchase of slots at a discount (Enterprise and Enterprise Plus)
AssignmentConnects a project, folder or organization to a reservation for a job type such as QUERY or PIPELINE
Idle slotsUnused baseline slots that other reservations in the same administration project can borrow, unless that is turned off
CREATE RESERVATION `bq-admin.region-eu.finance`
OPTIONS (edition = 'ENTERPRISE', slot_capacity = 200, autoscale_max_slots = 400);

CREATE ASSIGNMENT `bq-admin.region-eu.finance.financeetl`
OPTIONS (assignee = 'projects/finance-etl', job_type = 'QUERY');

Organizing workloads by business need

WorkloadTypical setup
Business-critical ETL with a deadlineDedicated reservation with baseline slots
BI dashboards with many small queriesSeparate reservation sized for concurrency, often with BI Engine
Ad hoc data scienceAutoscaling-only reservation or on-demand with custom quotas
Development projectsStandard edition reservation, or on-demand with low quotas

Separating workloads stops a burst of ad hoc queries from slowing the finance close. Idle slot sharing still lets one workload borrow capacity the others are not using.

Exam tip

"The nightly ETL misses its deadline when analysts run heavy queries" is solved by separate reservations with guaranteed baseline slots for ETL, not by more on-demand capacity.

Interactive or batch query jobs

PriorityBehaviourUse it for
Interactive (default)Runs as soon as possibleDashboards, analysts waiting for results
BatchQueued and started when idle resources are availableReports and back-office jobs that can wait

Queued queries that have not started time out: by default after 24 hours for batch and 6 hours for interactive. On-demand pricing is the same for both priorities.

bq query --batch --use_legacy_sql=false \
  'SELECT region, SUM(amount) FROM sales.order_facts GROUP BY region'

Managing jobs, queries and capacity

  • Cancel runaway jobs with bq cancel JOB_ID or from the console.
  • Move a project to another reservation by changing its assignment, with no downtime.
  • Raise or lower baseline slots and the autoscaling maximum as demand changes.
  • Use INFORMATION_SCHEMA.JOBS and the reservation views to see slot use per workload.

A worked example

A retailer on on-demand pricing pays a high, unpredictable bill, and the 05:00 finance job is late when analysts query at the same time. The engineer creates an Enterprise reservation with baseline slots for the finance project and an autoscaling-only reservation for analysts.

Monthly reports switch to batch priority. Slot usage charts show the finance job now finishes by 04:30, and cost is steadier.

On demandunpredictableFinance reservationbaseline slotsAnalyst reservationautoscale onlyBatch reportsqueued

How the exam asks about this

  • "Guarantee capacity for a critical pipeline while other teams share what is left." A reservation with baseline slots assigned to the pipeline's project; idle slots can be shared.
  • "Costs vary wildly month to month with steady heavy usage; finance wants predictability." Move to an edition with reservations, and a commitment if usage is stable.
  • "Reports can run any time in the next few hours and should not compete with dashboards." Run them as batch priority queries.

What to remember for the exam

  • On-demand bills bytes; editions bill slot-hours.
  • Standard, Enterprise and Enterprise Plus differ in features; commitments need Enterprise or higher.
  • Baseline slots are always on; autoscaling adds slots up to a maximum when needed.
  • Assignments map projects, folders or the organization to reservations by job type.
  • Batch priority queues jobs; by default a batch job still unstarted after 24 hours times out.
Watch out

Assigning a project to a reservation moves all its matching jobs off on-demand pricing. Size the reservation first, or the project's queries will queue for slots.

Common mistakes

Putting every workload in one reservation. Ad hoc spikes then delay critical jobs.

Buying a commitment for spiky, uncertain usage. Autoscaling or on-demand fits better until usage is steady.

Expecting batch priority to cost less on demand. The price per byte is the same; batch only changes when the query starts.

Check yourself

  • What is the difference between baseline and autoscaling slots?

    Baseline slots are always allocated and billed; autoscaling slots are added up to a maximum only when demand needs them and billed only while used.

  • What connects a project to a reservation?

    An assignment, created for a job type such as QUERY, on a project, folder or organization.

  • What happens to a batch-priority query that has not started after 24 hours?

    With the default queue timeout it times out and does not run; the timeout can be configured.

Topic 3 of 5 in Maintaining and automating data workloads

Test yourself on Maintaining and automating data workloads

The full Google Cloud Professional Data Engineer question bank has 733 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Google Cloud. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.