Sander van den Oord
Sander van den Oord

Reputation: 12818

Bigquery find with SQL how much data of a table is in Active storage or Long term Storage

In the BigQuery Console under Details I can see how much data of a BigQuery table is in Active Storage and how much in Long Term Storage.

bigquery metadata table storage size

How can I get this metadata via SQL?

Upvotes: 0

Views: 958

Answers (1)

Sander van den Oord
Sander van den Oord

Reputation: 12818

This can be done with INFORMATION_SCHEMA.PARTITIONS:

SELECT *
FROM <project_id>.<dataset_id>.INFORMATION_SCHEMA.PARTITIONS

More info can be found here:
https://cloud.google.com/bigquery/docs/information-schema-tables#partitions_view

Upvotes: 2

Related Questions