Request a demo

Glossary · BigQuery

What is BI Engine?

BigQuery BI Engine is an in-memory analysis service that caches frequently used table data and accelerates SQL queries from dashboards and other clients. You pay for reserved memory per project and region; the stages it accelerates scan 0 bytes on demand and use no reservation slots.

Also called: BigQuery BI Engine, BI Engine reservation, BI_CAPACITY, preferred tables, in-memory acceleration

How BI Engine works

You reserve BI Engine memory in a project and region. BigQuery then caches the parts of columns and partitions your queries use and runs the stages that scan and process that data in its vectorized in-memory engine. Stages it cannot accelerate fall back to normal BigQuery slots without failing the query.

ALTER BI_CAPACITY `analytics-prod.region-us.default`
SET OPTIONS (
  size_gb = 50,
  preferred_tables = ['analytics-prod.marts.daily_revenue', 'analytics-prod.marts.customers']);

Preferred tables limit acceleration to the tables you name, so ad hoc traffic does not evict dashboard data. A query is only accelerated if every table it reads is preferred, and a materialized view only if the view and its base tables are both on the list.

BI Engine works best on pre-joined or pre-aggregated tables and on queries joining one large fact table with up to four small dimension tables. It does not accelerate JavaScript UDFs, external tables, JSON columns, row-level security, queries returning more than 1 GiB, writes to permanent tables or BigQuery ML.

What it does to the bill

BI Engine is billed per GiB-hour of reserved memory in each project that has a reservation, whether or not queries use it; see BigQuery pricing for the rate in your region. In return, the query stage that reads table data is free:

  • On demand, accelerated stages are charged for 0 scanned bytes, and later stages add no on-demand charges.
  • On editions, the first stage uses no reservation slots; later stages use slots from the reservation.

Customers with editions commitments also get some BI Engine memory at no extra cost, scaled to the number of committed slots, if the BI Engine reservation is in a project of the same organization that uses those slots.

The trade-off is simple to measure: a dashboard that rereads the same tables all day saves its scan cost on every query, while a reservation sized for tables nobody queries is pure cost.

Measure acceleration in INFORMATION_SCHEMA

bi_engine_statistics in INFORMATION_SCHEMA.JOBS records whether each query was accelerated, and BI_CAPACITIES shows the reserved size:

SELECT
  IFNULL(bi_engine_statistics.acceleration_mode, 'NOT_ATTEMPTED') AS acceleration_mode,
  COUNT(*) AS queries,
  ROUND(SUM(total_bytes_billed) / POW(1024, 4) * 6.25, 2) AS on_demand_usd,
  ROUND(SUM(total_slot_ms) / 3600000, 1) AS slot_hours
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
  AND statement_type != 'SCRIPT'
GROUP BY acceleration_mode
ORDER BY queries DESC;

FULL_QUERY and FULL_INPUT mean BI Engine handled the inputs; PARTIAL_INPUT and BI_ENGINE_DISABLED come with the reasons BI Engine could not accelerate, in the same bi_engine_statistics record. Many disabled queries usually point to unsupported features or a reservation too small for the preferred tables. When comparing performance with and without BI Engine, turn off cached results, or cache hits will hide the difference.

Size the reservation from the data dashboards really read, using partitioned tables so only recent partitions need to fit in memory. The pricing calculator helps compare the memory cost with the scan cost it removes.

FAQ

Does BI Engine work only with Looker Studio?

No. BI Engine integrates with the BigQuery API, so queries from the console, Looker, Tableau, Power BI, client libraries and JDBC or ODBC drivers can all be accelerated without changes.

Which BigQuery editions support BI Engine?

Enterprise, Enterprise Plus and on-demand projects. Standard edition has no access to BI Engine acceleration.

What is the maximum BI Engine reservation size?

250 GiB per project per location by default. You can request an increase, which Google says can take 3 or more business days.

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.