Protect a critical query from competing jobs
When finance closes its books, a scheduled export consumes the same BigQuery capacity as interactive reports. The SQL plan has not changed. How can the operator test for contention?
Protect a critical query from competing jobs
A queueing problem and a scanning problem call for different changes. Compare job creation, start and finish times with bytes processed and slot consumption. Assignment to a reservation controls the pool, while baseline and maximum capacity determine what that pool can deliver.
In the recording
Assign the critical workload its own BigQuery reservation and enough baseline slots to isolate it from competing jobs.
Work through the decision
When finance closes its books, a scheduled export consumes the same BigQuery capacity as interactive reports. The SQL plan has not changed. How can the operator test for contention?
Check your reasoning
Compare queue time and slot use during and outside the export. Assign critical workloads to an appropriately sized reservation and confirm the jobs actually use it. Batch priority can delay flexible work but provides no dedicated pool by itself.
Decisions and tradeoffs
- Reservation assignment
- Map the relevant project, folder or organization and job type to a reservation with suitable capacity.
- Batch priority
- Let a flexible query run with batch scheduling when completion can wait. Priority alone does not isolate capacity.
- Interactive priority
- Request interactive scheduling for time-sensitive queries. This setting alone cannot guarantee an execution deadline.
- Queue-time measurement
- Compare job creation and start times to separate waiting for resources from execution time.
Read the reservation assignment before changing SQL
A query created at 15:00:00 starts at 15:00:48 and finishes at 15:00:56. Of 56 seconds elapsed, 48 were spent waiting. Check the job’s effective reservation, project and job type, concurrency, baseline slots and any autoscaling limit. Then run the same query when the flexible workload is idle and compare waiting time and execution time separately.
Practice the guide skills
- Inspect assignment, baseline capacity, autoscaling limits and actual job labels.
- Compare queue times for interactive and flexible batch work submitted together.
Official objectives for this lesson
Related lesson · Schedule work, trace a growing backlog and recover from retries
Protect a critical query from competing jobs quiz
Answer 3 questions. Check each answer for an explanation.
Worked example · Protect a critical query from competing jobs