Request a demo

Glossary · BigQuery

What is BigQuery slot?

A BigQuery slot is a virtual unit of compute that BigQuery uses to run SQL queries and other jobs. On-demand projects get slots bundled into a per-TiB price; editions reservations pay for slot capacity by the slot-hour, so slot time, not bytes scanned, drives the bill.

Also called: slot, slots, slot-hour, slot-ms, virtual CPU

How BigQuery uses slots

BigQuery turns every query into an execution plan of stages, splits each stage into units of work and runs those units in parallel on slots. The scheduler picks the parallelism stage by stage; you cannot set a slot count for a query. When a stage asks for more slots than are free, the remaining units of work queue and run as slots free up. The query takes longer, and you are not charged for the wait.

Inside a reservation, slots are shared by fair scheduling: equally between the projects that have queries running, then between the jobs of each project. A project running one heavy query gets the same share as a project running twenty small ones.

What slots do to the bill

  • On-demand: you pay $6.25 per TiB scanned (the first 1 TiB a month is free) and slots are included. A project generally gets up to 2,000 concurrent slots, with short bursts above that, and on-demand projects in one organization share a 20,000-slot cap. A CPU-heavy query over a small table is cheap; a light query over a wide table is not. See on-demand pricing.
  • Editions: you pay for the slots allocated to your reservations, per slot-hour: $0.04 Standard, $0.06 Enterprise and $0.10 Enterprise Plus, pay-as-you-go in the US multi-region. Bytes scanned stop mattering; slot time is the bill.

As an exchange rate, 100 Enterprise slots for one hour cost $6.00, about what on-demand charges to scan 0.96 TiB. Whether a workload is cheaper on slots or on bytes depends on how many bytes it scans per slot-hour. The pricing calculator runs that comparison, and BigQuery pricing covers both models in detail.

Measure slot usage in INFORMATION_SCHEMA

total_slot_ms in INFORMATION_SCHEMA.JOBS is the slot time a job consumed, in slot-milliseconds. Divide it by 3,600,000 for slot-hours, or by the job's runtime in milliseconds for its average slot count. This query ranks last week's users by slot-hours and prices the same work both ways:

SELECT
  user_email,
  COUNT(*) AS queries,
  ROUND(SUM(total_slot_ms) / 3600000, 1) AS slot_hours,
  ROUND(SUM(total_slot_ms) / 3600000 * 0.06, 2) AS enterprise_payg_usd,
  ROUND(SUM(total_bytes_billed) / POW(1024, 4) * 6.25, 2) AS on_demand_usd
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
  AND statement_type != 'SCRIPT' -- script rows repeat their child jobs' totals
GROUP BY user_email
ORDER BY slot_hours DESC;

Read enterprise_payg_usd as consumed slot time valued at the Enterprise rate, not as an invoice line. Reservations bill allocated capacity: idle baseline slots still cost money, the autoscaler bills scaled slots in 50-slot steps, and slots borrowed from another reservation's idle pool cost the borrower nothing. on_demand_usd also ignores the free monthly TiB.

Common misreadings

  • Average slots hide peaks. A job that averaged 50 slots may have had a stage that used many times more. INFORMATION_SCHEMA.JOBS_TIMELINE has one row per job per second, with period_slot_ms for that second.
  • More slots can raise slot time. Extra baseline or autoscaling makes queries finish sooner, but Google notes that the overhead of more parallel workers can increase a query's total total_slot_ms.
  • Slow is not always expensive. A query that waited in a busy reservation shows a long runtime with modest slot time, and period_estimated_runnable_units in JOBS_TIMELINE shows work that was ready but had no slot. Check contention before rewriting the SQL; the slot efficiency guide walks through it.

FAQ

How many slots does a BigQuery query use?

BigQuery decides at run time, stage by stage, from how much data the stage processes, how complex it is and how many slots are free. You cannot set it per query. For a finished query, divide total_slot_ms in INFORMATION_SCHEMA.JOBS by the runtime in milliseconds to get its average slot count.

Is a BigQuery slot the same as a CPU?

Google's pricing page calls slots virtual CPUs, but you never pin or see individual slots. The scheduler hands them to stages of your queries and moves them between queries as demand changes, so a query's slot count changes while it runs.

How do I turn slot usage into cost?

Divide slot-milliseconds by 3,600,000 to get slot-hours, then multiply by the edition rate: $0.04 Standard, $0.06 Enterprise or $0.10 Enterprise Plus per slot-hour pay-as-you-go in the US multi-region. Treat it as an estimate, because reservations bill allocated slots, not consumed slot time.

Read next

Browse the full glossary

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.