Request a demo

Glossary · BigQuery

What is Long-term storage?

Long-term storage is BigQuery's lower storage rate for any table or partition not modified for 90 consecutive days: about half the active price, applied automatically, with no change in performance or durability. Any write to the table or partition resets its 90-day timer.

Also called: long-term storage pricing, BigQuery long-term storage, 90-day storage discount, storage tier

How it works

BigQuery tracks when the data in each table, or each partition of a partitioned table, was last modified. After 90 consecutive days without a modification, that storage is billed at the long-term rate, roughly 50% less than active. Nothing moves and nothing changes for queries; the discount is prorated if the threshold is reached mid-month.

In the US multi-region the rates per GiB-month are:

Switching a dataset's billing model does not push long-term tables back to active. Long-term pricing applies only to BigQuery storage, not to external tables in Cloud Storage or elsewhere.

What resets the timer

The 90-day clock restarts whenever the data changes:

  • load jobs and query jobs that append to or overwrite the table;
  • copy jobs that write into it;
  • DML (INSERT, UPDATE, DELETE, MERGE);
  • CREATE OR REPLACE TABLE;
  • streaming through the Storage Write API.

Querying the table, creating views on it, exporting it, copying it elsewhere and updating its metadata do not reset it.

The expensive pattern is the full rebuild. A model that recreates a 50 TiB table every night keeps all of it active: 51,200 GiB at $0.02 is $1,024 a month on logical billing, against $512 if all of it had aged into long-term. Partitioning the table and rewriting only recent partitions lets the rest age into long-term pricing. A MERGE that touches old partitions resets those partitions, so filter it on the partitioning column.

See it in INFORMATION_SCHEMA

INFORMATION_SCHEMA.TABLE_STORAGE splits every table into active and long-term bytes. Large tables with no long-term bytes are being rewritten in full:

SELECT
  table_schema AS dataset,
  table_name,
  ROUND(active_logical_bytes / POW(1024, 3), 1) AS active_gib,
  ROUND(long_term_logical_bytes / POW(1024, 3), 1) AS long_term_gib,
  ROUND(100 * SAFE_DIVIDE(long_term_logical_bytes, total_logical_bytes), 1) AS long_term_pct,
  storage_last_modified_time
FROM `region-us`.INFORMATION_SCHEMA.TABLE_STORAGE
WHERE NOT deleted AND table_type = 'BASE TABLE'
ORDER BY active_logical_bytes DESC
LIMIT 20;

For one dataset, the PARTITIONS view (in Preview) shows the tier of each partition:

SELECT
  table_name,
  storage_tier,
  COUNT(*) AS partitions,
  ROUND(SUM(total_logical_bytes) / POW(1024, 3), 1) AS logical_gib,
  MAX(last_modified_time) AS last_change
FROM analytics.INFORMATION_SCHEMA.PARTITIONS
GROUP BY table_name, storage_tier
ORDER BY table_name, storage_tier;

Long-term storage lowers the price of data nobody touches; it does not tell you whether anyone still needs it. Tables with no reads in months are candidates for deletion or archiving, which saves the other half. The pricing calculator estimates both.

FAQ

Does querying a table reset BigQuery long-term storage?

No. Reading a table, creating a view on it, exporting it, copying it to another table or updating its metadata leave the timer alone. Only actions that change its data reset it: loads, query results written into it, copy jobs into it, DML, CREATE OR REPLACE TABLE and streaming with the Storage Write API.

Is long-term storage slower to query?

No. Google states there is no difference in performance, durability or availability between active and long-term storage. Only the price changes.

Does long-term storage work per partition?

Yes. Each partition of a partitioned table is evaluated on its own, so old partitions move to long-term pricing while new ones keep loading. An unpartitioned table only qualifies when nothing in it has changed for 90 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.