Glossary · Governance and security
What is metadata?
Metadata is data about data: schemas, owners, descriptions, sizes, update times, query history, lineage and access rules. In BigQuery it comes from INFORMATION_SCHEMA views, job history and Cloud Audit Logs, and is enough to monitor freshness, cost and usage without reading table contents.
Kinds of metadata
- Technical: schemas, data types, partitioning and clustering, sizes, row counts, creation and modification times.
- Operational: which jobs ran, who ran them, what they read and wrote, how long they took, how many bytes and slots they used, whether they failed.
- Business: descriptions, owners, glossary terms, classifications, SLAs and certifications.
- Governance: access policies, policy tags, row access policies, retention settings.
Technical and operational metadata are produced automatically; business metadata has to be written, ideally next to the code that builds the data.
Where BigQuery keeps metadata
- INFORMATION_SCHEMA views: SCHEMATA (datasets), TABLES and TABLE_OPTIONS, COLUMNS and COLUMN_FIELD_PATHS, PARTITIONS, TABLE_STORAGE, JOBS and JOBS_TIMELINE, RESERVATIONS_TIMELINE, ROW_ACCESS_POLICIES and more. Queries need a dataset or region qualifier, for example
`region-us`.INFORMATION_SCHEMA.COLUMNS. See INFORMATION_SCHEMA. - Job history: JOBS keeps 180 days of jobs with referenced and destination tables, which is the raw material for usage analysis, lineage and cost attribution.
- Cloud Audit Logs: admin activity and data access events, including reads that don't run query jobs, such as Storage Read API sessions.
- Knowledge Catalog: business metadata, glossaries and lineage across services. See data catalog.
Example: find columns by name across a project
SELECT
table_schema AS dataset_id,
table_name,
column_name,
data_type,
ARRAY_LENGTH(policy_tags) > 0 AS has_policy_tag
FROM `region-us`.INFORMATION_SCHEMA.COLUMNS
WHERE REGEXP_CONTAINS(LOWER(column_name), r'customer_id')
ORDER BY dataset_id, table_name;
The same view answers "which tables have a customer_id column I could join on", "which columns use a deprecated type" and "which sensitive-looking columns carry no policy tag".
Why metadata matters for reliability and cost
Freshness (last modified time), volume (row counts and bytes written per job), schema changes (column lists over time), failures (job errors) and lineage (referenced and destination tables) can all be derived from metadata and logs, without reading table contents. So can cost: bytes billed and slot time per job, storage per table, and which tables nobody reads. That makes metadata the cheapest and least invasive basis for observability and FinOps on BigQuery, which is how Masthead monitors BigQuery without reading data (how it works).
Common pitfalls
- Region qualifiers. INFORMATION_SCHEMA views are regional; a project with US and EU datasets needs one query per region.
- Short history. JOBS keeps 180 days; persist what you need longer.
- Stale business metadata. Descriptions that live in a wiki drift; generate them from dbt or Dataform model docs.
FAQ
Is querying INFORMATION_SCHEMA free?
No. On on-demand pricing each INFORMATION_SCHEMA query bills at least 10 MB, and results are never cached, so every run is charged. On capacity pricing these queries use slots like any other.
What is the difference between INFORMATION_SCHEMA and __TABLES__?
__TABLES__ is an older per-dataset meta-table with row counts, sizes and last modified times. INFORMATION_SCHEMA is the documented, broader set of views covering datasets, tables, columns, partitions, storage, jobs and reservations, at dataset, project or region level.
