TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER view

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

TheINFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER view providesdaily storage usage totals for the past 90 days for the following types of tables.

  • Standard tables
  • Materialized views
  • Table clones that have a delta in bytes from the base table
  • Table snapshots that have a delta in bytes from the base table

TheINFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER view excludestables without billable bytes. The following table types are excluded:

  • External tables
  • Anonymous tables
  • Empty tables
  • Table clones that have no delta in bytes from the base table
  • Table snapshots that have no delta in bytes from the base table

When you query theINFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDERview, the query results contain one row per day for each table ormaterialized view in the current project's parent folder, including itssubfolders.

This table's data isn't available in real time. Table data takes approximately72 hours to appear in this view.

The view returns storage usage in MiB seconds. For example, if a project uses1,000,000 physical bytes for 86,400 seconds (24 hours), the total physicalusage is 86,400,000,000 byte seconds, which converts to 82,397 MiB seconds,as shown in the following example:

86,400,000,000 / 1,024 / 1,024 = 82,397

The storage usage value can be found in theBILLABLE_TOTAL_PHYSICAL_USAGEcolumn. For more information, seeStorage pricing details.

Note: Data for this view has a start date of October 1, 2023. Youcan query the view for dates prior to that, but the data returned isincomplete.

Required permissions

To query theINFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER view, youneed the following Identity and Access Management (IAM) permissions for the parent folder of the project:

  • bigquery.tables.get
  • bigquery.tables.list

Each of the following predefined IAM roles includes the precedingpermissions:

  • roles/bigquery.dataViewer
  • roles/bigquery.dataEditor
  • roles/bigquery.metadataViewer
  • roles/bigquery.admin

For more information about BigQuery permissions, seeBigQuery IAM roles and permissions.

Schema

TheINFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER view has thefollowing schema:

Column nameData typeValue
usage_dateDATEThe billing date for the bytes shown, using theAmerica/Los_Angeles time zone
folder_numbersREPEATED INTEGER Number IDs of folders that contain the project, starting with the folder that immediately contains the project, followed by the folder that contains the child folder, and so forth. For example, ifFOLDER_NUMBERS is[1, 2, 3], then folder1 immediately contains the project, folder2 contains1, and folder3 contains2. This column is only populated inTABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER.
project_idSTRINGThe project ID of the project that contains the dataset
table_catalogSTRINGThe project ID of the project that contains the dataset
project_numberINT64The project number of the project that contains the dataset
table_schemaSTRINGThe name of the dataset that contains the table or materialized view, also referred to as thedatasetId
table_nameSTRINGThe name of the table or materialized view, also referred to as thetableId
billable_total_logical_usageINT64

The total logical usage, in MiB second.

Returns 0 if the dataset uses the physical storagebilling model.

billable_active_logical_usageINT64

The logical usage that is less than 90 days old, in MiB second.

Returns 0 if the dataset uses the physical storagebilling model.

billable_long_term_logical_usageINT64

The logical usage that is more than 90 days old, in MiB second.

Returns 0 if the dataset uses the physical storagebilling model.

billable_total_physical_usageINT64

The total usage in MiB second. This includes physical bytes used for fail-safe andtime travel storage.

Returns 0 if the dataset uses the logical storagebilling model.

billable_active_physical_usageINT64

The physical usage that is less than 90 days old, in MiB second. This includes physical bytes used for fail-safe andtime travel storage.

Returns 0 if the dataset uses the logical storagebilling model.

billable_long_term_physical_usageINT64

The physical usage that is more than 90 days old, in MiB second.

Returns 0 if the dataset uses the logical storagebilling model.

For stability, we recommend that you explicitly list columns in your information schema queries instead ofusing a wildcard (SELECT *). Explicitly listing columns prevents queries frombreaking if the underlying schema changes.

Scope and syntax

Queries against this view must include aregion qualifier.If you don't specify a regional qualifier, metadata is retrieved from allregions. The following table explains the region scope for this view:

View nameResource scopeRegion scope
[PROJECT_ID.]`region-REGION`.INFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDERFolder that contains the specified projectREGION
Replace the following:
  • Optional:PROJECT_ID: the ID of your Google Cloud project. If not specified, the default project is used.
  • REGION: anydataset region name. For example,`region-us`.

    Note: You must usea region qualifier to queryINFORMATION_SCHEMA views. The location of the query execution must match the region of theINFORMATION_SCHEMA view.

To retrieve storage information for tables in the specified project's parentfolder, run the following query:

SELECT*FROM`myProject`.`region-REGION`.INFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER;

Example

The following query shows usage for all tables in the folder on the mostrecent date:

SELECTusage_date,project_id,table_schema,table_name,billable_total_logical_usage,billable_total_physical_usageFROM(SELECT*,ROW_NUMBER()OVER(PARTITIONBYproject_id,table_schema,table_nameORDERBYusage_dateDESC)ASrankFROM`region-REGION`.INFORMATION_SCHEMA.TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER)WHERErank=1;

The result is similar to the following:

+--------------+------------+--------------+------------+------------------------------+-------------------------------+| usage_date   | project_id | table_schema | table_name | billable_total_logical_usage | billable_total_physical_usage |+--------------+------------+--------------+------------+------------------------------+-------------------------------+|  2023-04-03  | project1   | dataset_A    | table_x    |     734893409201             |              0                |+--------------+------------+--------------+------------+------------------------------+-------------------------------+|  2023-04-03  | project1   | dataset_A    | table_z    |     110070445455             |              0                |+--------------+------------+--------------+------------+------------------------------+-------------------------------+|  2023-04-03  | project1   | dataset_B    | table_y    |            0                 |         52500873256           |+--------------+------------+--------------+------------+------------------------------+-------------------------------+|  2023-04-03  | project1   | dataset_B    | table_t    |            0                 |         32513713981           |+--------------+------------+--------------+------------+------------------------------+-------------------------------+|  2023-04-03  | project2   | dataset_C    | table_m    |      8894535352              |              0                |+--------------+------------+--------------+------------+------------------------------+-------------------------------+|  2023-04-03  | project2   | dataset_C    | table_n    |      4183337201              |              0                |+--------------+------------+--------------+------------+------------------------------+-------------------------------+

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.