skip to content

In BigQuery's Connected Sheets, what happens when a pivot table refreshes?

level: juniorimportance: nice to knowfreq 25%

answer

  1. the spreadsheet holds results, not rows
  2. every pivot change is a query job
  3. permissions follow the person, not the sheet
  4. scheduled refreshes are where the bill hides

basics

~20 s

Connected Sheets issues a real BigQuery query job on every refresh and writes only the results into the spreadsheet. The table itself is never copied into the sheet, so each refresh is billed and subject to the user's BigQuery permissions.

solid answer

~50 s

Connected Sheets lets a spreadsheet user build pivot tables, charts and formulas over a BigQuery table without writing SQL. What looks like a spreadsheet is a thin client: the sheet holds a connection and the *results*, never the underlying rows. Every action that changes what is displayed — adding a pivot dimension, changing a filter, hitting refresh, or a scheduled refresh firing — is translated into SQL and run as a BigQuery job billed to the chosen billing project. Because it is an ordinary query job, it runs under a Google identity, so IAM and any row access policies on the table apply exactly as they would for a hand-written query. That is the feature's real value: analysts get spreadsheet ergonomics without anyone exporting a CSV that then lives forever in Drive. The cost trap is scheduled refreshes multiplied across many sheets over a wide fact table. Point Connected Sheets at a partitioned, clustered summary table, not the raw events.

code

sql · 7 lines
sql
-- Connect sheets to this, not to the raw event table
CREATE OR REPLACE VIEW `reporting.orders_by_day` AS
SELECT order_date, country, product_line,
       COUNT(*) AS orders,
       SUM(total_amount) AS revenue
FROM `analytics.orders_daily`
GROUP BY order_date, country, product_line;

go deeper

for a junior

Know that Connected Sheets keeps the data in BigQuery and runs a query on every refresh, so the spreadsheet only ever holds results and the usual permissions still apply.

for a middle

Be able to explain the cost shape — one job per interaction and per scheduled refresh — and why pointing sheets at a partitioned summary table matters.

for a senior

Discuss it as a governance lever: it replaces ungoverned CSV exports, inherits row-level security through the querying identity, and needs quotas plus refresh review to stay affordable.

for a principal

Own the self-service policy — which curated surfaces analysts are allowed to connect to, how spreadsheet-driven spend is attributed and capped, and where the line sits between self-service and a managed BI tool.

## What it is Connected Sheets is a Google Sheets feature that binds a sheet to a BigQuery table or view. The analyst gets the familiar spreadsheet surface — pivot tables, charts, formulas, filters — while the data stays in BigQuery. It exists because the alternative people default to is exporting a CSV, which immediately becomes a stale, ungoverned copy of production data sitting in someone's Drive. ## What a refresh does Every interaction that changes the displayed result is compiled into SQL and submitted as a BigQuery query job. That includes the obvious refresh button, but also adding a column to a pivot, changing a filter value, and scheduled refreshes configured to run on a timetable. Only the aggregated result comes back into the sheet's cells. Three consequences follow. **It is billed like any query.** The job is charged to the billing project selected when the connection was set up — bytes scanned under on-demand pricing, or slot time against a reservation. A pivot over a wide fact table costs the same as the equivalent hand-written aggregate. **It is governed like any query.** The job runs under a Google identity — the person interacting, and for a scheduled refresh the person who set the schedule up. Dataset permissions, authorized views and row access policies all apply. A user who cannot query the table cannot see it through a spreadsheet either, which is why this is the sanctioned alternative to CSV export. **It is as fresh as the last refresh.** The sheet is not live. Between refreshes the cells hold whatever the last job returned, and anyone reading the sheet is reading a snapshot with a timestamp. ## Preview, extract and the sheet's limits Connected Sheets offers a preview of sample rows so an analyst can see the shape of the data without pulling it all. It also offers an **extract**: a bounded subset of rows materialised into the sheet, after which interaction is instant and free but the data is a fixed snapshot until re-extracted. Extracts are right for small, slow-moving reference data and wrong for anything an analyst expects to be current. A sheet cannot hold a large table under any circumstances — spreadsheets have hard cell limits far below warehouse scale. That constraint is a feature: it forces the aggregation to happen in BigQuery, which is where it belongs. ## Cost management The surprise bill from Connected Sheets is almost always shaped the same way: many sheets, each with a scheduled refresh, each pivoting a raw event table. Nobody's individual sheet is unreasonable; the aggregate is. The mitigations are ordinary BigQuery hygiene applied to a new consumer: - Expose a **summary table or view** at the grain analysts actually pivot on, and connect sheets to that rather than to the raw fact table. - Ensure the source is **partitioned** on the date column analysts filter by, and **clustered** on their common dimensions, so filters prune. - Review **scheduled refresh** frequency: a sheet over a nightly-loaded table refreshing hourly does seven-eighths of its work for nothing. - Consider a **BI Engine reservation** in the same location, since Connected Sheets is exactly the repetitive narrow-column access pattern it accelerates. - Apply **custom quotas** so a single user's sheets cannot run away with the month's budget. ```sql CREATE OR REPLACE TABLE `analytics.orders_daily` PARTITION BY order_date CLUSTER BY country, product_line AS SELECT order_date, country, product_line, COUNT(*) AS orders, SUM(total_amount) AS revenue FROM `analytics.orders` GROUP BY order_date, country, product_line; ``` ## How to talk about it in an interview The point to make is not that the feature exists but why it matters organisationally: it moves spreadsheet users from *copying* warehouse data to *querying* it. The copy is what breaks governance — a CSV has no row-level security, no lineage, no freshness, and no way to revoke access. Connected Sheets keeps the data where the controls are and gives up nothing the analyst actually needed.

  • Does a Connected Sheets pivot show live data as the underlying BigQuery table changes?
    No. The cells hold the result of the last refresh, whether that was manual or scheduled, so the sheet is a timestamped snapshot rather than a live view. Anyone circulating the sheet should treat the refresh time as part of the data. If genuine currency matters, either shorten the schedule — accepting the extra query cost — or use a dashboard tool with its own freshness controls.
  • When is a Connected Sheets extract the right choice over a live connection?
    When the dataset is small and slow-moving — a reference list, a lookup dimension, a finished monthly summary. The extract materialises a bounded subset into the sheet, after which filtering and pivoting are instant and cost nothing. The trade-off is that the data is frozen until you re-extract, which makes extracts wrong for anything an analyst expects to reflect today.
  • How do BigQuery row access policies interact with a Connected Sheets refresh?
    They apply, because the refresh is a normal query job running under a Google identity — the interacting user, or whoever configured a scheduled refresh. Each analyst sees only the rows their policies grant. The caveat is the same as for any BI surface: if the connection somehow resolves to a shared identity, per-user filtering collapses to that one identity's row set.

saying these in an interview costs you the question

  • Thinks the spreadsheet holds a copy of the BigQuery table
  • Assumes refreshes are free because they happen in Sheets
  • Believes the sheet updates live as the table changes
  • Points a sheet at a raw event table and schedules hourly refreshes
  • Treats it as equivalent to exporting a CSV for governance purposes

context