Introduction to continuous queries

This document describes BigQuery continuous queries.

BigQuery continuous queries are SQL statements that runcontinuously. Continuous queries let you analyze incoming data inBigQuery in real time. You can insert the output rows producedby a continuous query into a BigQuery table or export them toPub/Sub, Bigtable, or Spanner. Continuousqueries can process data that has been written tostandard BigQuery tablesby using one of the following methods:

You can use continuous queries to perform time sensitive tasks, such ascreating and immediately acting on insights, applying real time machinelearning (ML) inference, and replicating data into other platforms. Thislets you use BigQuery as an event-driven data processingengine for your application's decision logic.

The following diagram shows common continuous query workflows:

Diagram illustrating common BigQuery continuous query workflows, including data ingestion, processing, and export to destinations like Bigtable and Pub/Sub.

Use cases

Common use cases where you might want to use continuous queries are as follows:

  • Personalized customer interaction services: use generative AI to createtailored messages customized for each customer interaction.
  • Anomaly detection: build solutions that let you perform anomaly and threatdetection on complex data in real time, so that you can react to issues morequickly.
  • Customizable event-driven pipelines: use continuous query integration withPub/Sub to trigger downstream applications based on incomingdata.
  • Data enrichment and entity extraction: use continuous queries to performreal time data enrichment and transformation by using SQL functions andML models.
  • Reverse extract-transform-load (ETL): perform real time reverse ETL into otherstorage systems more suited for low latency application serving. For example,analyzing or enhancing event data that is written to BigQuery,and then streaming it to Bigtable or Spanner for applicationserving.

Supported operations

The following operations are supported in continuous queries:

Authorization

TheGoogle Cloud access tokensthat are used when running continuous query jobs have a time to live (TTL) oftwo days when they are generated by a user account. Therefore, such jobs stoprunning after two days. The access tokens that are generated by serviceaccounts can run longer, but must still adhere to the maximum query runtime.For more information, seeRun a continuous query by using a service account.

Locations

Continuous queries are supported in the followinglocations:

Region descriptionRegion nameDetails
Americas
US multi-regionus
Columbusus-east5
Dallasus-south1leaf iconLow CO2
Iowaus-central1leaf iconLow CO2
Las Vegasus-west4
Los Angelesus-west2
Mexiconorthamerica-south1
Montréalnorthamerica-northeast1leaf iconLow CO2
Northern Virginiaus-east4
Oregonus-west1leaf iconLow CO2
Salt Lake Cityus-west3
Santiagosouthamerica-west1leaf iconLow CO2
São Paulosouthamerica-east1leaf iconLow CO2
South Carolinaus-east1
Torontonorthamerica-northeast2leaf iconLow CO2
Asia Pacific
Delhiasia-south2
Hong Kongasia-east2
Jakartaasia-southeast2
Melbourneaustralia-southeast2
Mumbaiasia-south1
Osakaasia-northeast2
Seoulasia-northeast3
Singaporeasia-southeast1
Sydneyaustralia-southeast1
Taiwanasia-east1
Tokyoasia-northeast1
Europe
EU multi-regioneu
Belgiumeurope-west1leaf iconLow CO2
Berlineurope-west10
Finlandeurope-north1leaf iconLow CO2
Frankfurteurope-west3
Londoneurope-west2leaf iconLow CO2
Madrideurope-southwest1leaf iconLow CO2
Milaneurope-west8
Netherlandseurope-west4leaf iconLow CO2
Pariseurope-west9leaf iconLow CO2
Stockholmeurope-north2leaf iconLow CO2
Turineurope-west12
Warsaweurope-central2
Zuricheurope-west6leaf iconLow CO2
Middle East
Dohame-central1
Dammamme-central2
Tel Avivme-west1
Africa
Johannesburgafrica-south1

Limitations

Continuous queries are subject to the following limitations:

Reservation limitations

  • You must create Enterprise edition or Enterprise Pluseditionreservations in order to runcontinuous queries. Continuous queries don't support the on-demand computebilling model.
  • When you create aCONTINUOUSreservation assignment,the associated reservation is limited to at most500 slots. You can request an increase to this limit by contactingbq-continuous-queries-feedback@google.com.
  • You can't create a reservation assignment that uses a differentjob type in thesame reservation as a continuous query reservation assignment.
  • You can't configure continuous query concurrency. BigQueryautomatically determines the number of continuous queries that can runconcurrently, based on available reservation assignments that use theCONTINUOUS job type.
  • When running multiple continuous queries using the same reservation,individual jobs might not split available resources fairly, asdefined byBigQuery fairness.

Slots autoscaling

Continuous queries can useslot autoscaling to dynamically scaleallocated capacity to accommodate your workload. As your continuous queriesworkload increases or decreases, BigQuery dynamically adjustsyour slots.

After a continuous query starts running, it activelylistens for incoming data,which consumes slot resources. While a reservation with a running continuousquery does not scale down to zero slots, an idle continuous query that isprimarily listening for incoming data is expected to consume a minimal amount ofslots, typically around 1 slot.

Idle slot sharing

Continuous queries can useidle slot sharingto share unused slot resources with other reservations andjob types.

  • ACONTINUOUSreservation assignment is stillrequired to run a continuous query and can't solely rely on idle slotsfrom other reservations. Thus aCONTINUOUS reservation assignment requireseither a non-zero slot baseline or a non-zero slot autoscaling configuration.
  • Only idle baseline slots or committed slots from aCONTINUOUS reservationassignment are sharable.Autoscaled slots aren'tshareable as idle slots for other reservations.

Pricing

Continuous queries useBigQuery capacity compute pricing,which is measured inslots.To run continuous queries, you must have areservation that uses theEnterprise or Enterprise Plus edition,and areservation assignmentthat uses theCONTINUOUS job type.

Usage of other BigQuery resources, such as data ingestion andstorage, are charged at the rates shown inBigQuery pricing.

Usage of other services that receive continuous query results or that are calledduring continuous query processing are charged at the rates published for thoseservices. For the pricing of other Google Cloud services used by continuousqueries, see the following topics:

What's next

Trycreating a continuous query.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.