# Introduction to INFORMATION_SCHEMA

BigQuery `INFORMATION_SCHEMA` views let you retrieve metadata about
your BigQuery objects. You can query these read-only,
system-defined views to analyze resources like datasets, jobs, and access
control.

In BigQuery, you query `INFORMATION_SCHEMA` views using
GoogleSQL by specifying a scope and a view. For example, to get
metadata for tables in a dataset, you specify
`myDataset.INFORMATION_SCHEMA.TABLES`.

The following table lists the available views:

| Resource type | INFORMATION_SCHEMA View |
|---|---|
| Access control | `OBJECT_PRIVILEGES` `ROW_ACCESS_POLICIES` |
| AI indexes ([Preview](https://cloud.google.com/products#product-launch-stages)) | `AI_INDEXES` `AI_INDEX_COLUMNS` |
| BI Engine | `BI_CAPACITIES` `BI_CAPACITY_CHANGES` |
| Configurations | `EFFECTIVE_PROJECT_OPTIONS` `ORGANIZATION_OPTIONS` `ORGANIZATION_OPTIONS_CHANGES` `PROJECT_OPTIONS` `PROJECT_OPTIONS_CHANGES` |
| Datasets | `SCHEMATA SCHEMATA_LINKS SCHEMATA_OPTIONS SHARED_DATASET_USAGE SCHEMATA_REPLICAS SCHEMATA_REPLICAS_BY_FAILOVER_RESERVATION ` |
| Graphs | `PROPERTY_GRAPHS` |
| Jobs | `JOBS_BY_PROJECT†` `JOBS_BY_USER` `JOBS_BY_FOLDER` `JOBS_BY_ORGANIZATION` |
| Jobs by timeslice | `JOBS_TIMELINE_BY_PROJECT†` `JOBS_TIMELINE_BY_USER` `JOBS_TIMELINE_BY_FOLDER` `JOBS_TIMELINE_BY_ORGANIZATION` |
| Recommendations and insights | `INSIGHTS_BY_PROJECT†` `RECOMMENDATIONS_BY_PROJECT†` `RECOMMENDATIONS_BY_ORGANIZATION` |
| Reservations | `ASSIGNMENTS_BY_PROJECT†` `ASSIGNMENT_CHANGES_BY_PROJECT†` `CAPACITY_COMMITMENTS_BY_PROJECT†` `CAPACITY_COMMITMENT_CHANGES_BY_PROJECT†` `FAILOVER_HISTORY_BY_PROJECT†` `RESERVATIONS_BY_PROJECT†` `RESERVATION_CHANGES_BY_PROJECT†` `RESERVATIONS_TIMELINE_BY_PROJECT†` |
| Routines | `PARAMETERS` `ROUTINES` `ROUTINE_OPTIONS` |
| Search indexes | `SEARCH_INDEXES` `SEARCH_INDEX_COLUMNS` `SEARCH_INDEX_COLUMN_OPTIONS` `SEARCH_INDEX_OPTIONS` `SEARCH_INDEXES_BY_ORGANIZATION` |
| Sessions | `SESSIONS_BY_PROJECT†` `SESSIONS_BY_USER` |
| Streaming | `STREAMING_TIMELINE_BY_PROJECT†` `STREAMING_TIMELINE_BY_FOLDER` `STREAMING_TIMELINE_BY_ORGANIZATION` |
| Tables | `COLUMNS` `COLUMN_FIELD_PATHS` `CONSTRAINT_COLUMN_USAGE` `KEY_COLUMN_USAGE` `PARTITIONS` `TABLES` `TABLE_OPTIONS` `TABLE_CONSTRAINTS` `TABLE_SNAPSHOTS` `TABLE_STORAGE_BY_PROJECT†` `TABLE_STORAGE_BY_FOLDER` `TABLE_STORAGE_BY_ORGANIZATION` `TABLE_STORAGE_USAGE_TIMELINE_BY_PROJECT†` `TABLE_STORAGE_USAGE_TIMELINE_BY_FOLDER` `TABLE_STORAGE_USAGE_TIMELINE_BY_ORGANIZATION` |
| Vector indexes | `VECTOR_INDEXES` `VECTOR_INDEX_COLUMNS` `VECTOR_INDEX_OPTIONS` |
| Views | `VIEWS` `MATERIALIZED_VIEWS` |
| Write API | `WRITE_API_TIMELINE_BY_PROJECT†` `WRITE_API_TIMELINE_BY_FOLDER` `WRITE_API_TIMELINE_BY_ORGANIZATION` |

^†^ For `*BY_PROJECT` views, the `BY_PROJECT` suffix is optional. For
example, querying `INFORMATION_SCHEMA.JOBS_BY_PROJECT` and `INFORMATION_SCHEMA.JOBS`
return the same results.

> [!NOTE]
> **Note:** Not all `INFORMATION_SCHEMA` views are supported for [BigQuery Omni system tables](https://docs.cloud.google.com/bigquery/docs/omni-introduction.md.txt#limitations). You can view resource metadata with `INFORMATION_SCHEMA` for [Amazon S3](https://docs.cloud.google.com/bigquery/docs/omni-aws-create-external-table.md.txt#view_resource_metadata) and [Azure Storage](https://docs.cloud.google.com/bigquery/docs/omni-azure-create-external-table.md.txt#view_resource_metadata_with_information_schema).

## Pricing

For projects that use on-demand pricing, queries against `INFORMATION_SCHEMA`
views incur a minimum of 10 MB of data processing charges, even if the bytes
processed by the query are less than 10 MB. 10 MB is the minimum
billing amount for on-demand queries. For more information, see
[On-demand pricing](https://cloud.google.com/bigquery/pricing#on_demand_pricing).

For projects that use capacity-based pricing, queries against `INFORMATION_SCHEMA`
views and tables consume your purchased BigQuery slots. For more
information, see [capacity-based pricing](https://cloud.google.com/bigquery/pricing#capacity_compute_analysis_pricing).

Because `INFORMATION_SCHEMA` queries are not cached, you are charged each time
that you run an `INFORMATION_SCHEMA` query, even if the query text is the same
each time you run it.

You are not charged storage fees for the `INFORMATION_SCHEMA` views.

## Syntax

An `INFORMATION_SCHEMA` view needs to be qualified with a dataset or region.

> [!NOTE]
> **Note:** You must [specify a location](https://docs.cloud.google.com/bigquery/docs/locations.md.txt#specify_locations) to query an `INFORMATION_SCHEMA` view. Querying an `INFORMATION_SCHEMA` view fails with the following error if the location of the query execution doesn't match the location of the dataset or regional qualifier used:  
>
> ```
> Table myproject: region-us.INFORMATION_SCHEMA.[VIEW] not found in location US
> ```

### Dataset qualifier

When present, a dataset qualifier restricts results to the specified dataset.
For example:

```googlesql
-- Returns metadata for tables in a single dataset.
SELECT * FROM myDataset.INFORMATION_SCHEMA.TABLES;
```

The following `INFORMATION_SCHEMA` views support dataset qualifiers:

- `COLUMNS`
- `COLUMN_FIELD_PATHS`
- `MATERIALIZED_VIEWS`
- `PARAMETERS`
- `PARTITIONS`
- `ROUTINES`
- `ROUTINE_OPTIONS`
- `ROW_ACCESS_POLICIES`
- `TABLES`
- `TABLE_OPTIONS`
- `VIEWS`

### Region qualifier

Region qualifiers are represented using a
`region-REGION` syntax.
Any [dataset location name](https://docs.cloud.google.com/bigquery/docs/locations.md.txt) can be used for
`REGION`. For example, the following region qualifiers
are valid:

- `region-us`
- `region-asia-east2`
- `region-europe-north1`

When present, a region qualifier restricts results to the specified location.
[Region qualifiers](https://docs.cloud.google.com/bigquery/docs/locations.md.txt#locations_and_regions) aren't
hierarchical, which means the EU multi-region does not include `europe-*`
regions nor does the US multi-region include the `us-*` regions. For example,
the following query returns metadata for all datasets in the `US` multi-region
for the project in which the query is executing, but doesn't include datasets in
the `us-west1` region:

```googlesql
-- Returns metadata for all datasets in the US multi-region.
SELECT * FROM region-us.INFORMATION_SCHEMA.SCHEMATA;
```

The following `INFORMATION_SCHEMA` views don't support region qualifiers:

- [`INFORMATION_SCHEMA.PARTITIONS`](https://docs.cloud.google.com/bigquery/docs/information-schema-partitions.md.txt#scope_and_syntax)
- [`INFORMATION_SCHEMA.SEARCH_INDEXES`](https://docs.cloud.google.com/bigquery/docs/information-schema-indexes.md.txt#scope_and_syntax)
- [`INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS`](https://docs.cloud.google.com/bigquery/docs/information-schema-index-columns.md.txt)
- [`INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS`](https://docs.cloud.google.com/bigquery/docs/information-schema-index-options.md.txt)

If neither a region qualifier nor a dataset qualifier is specified, you will
receive an error.

Queries against a region-qualified `INFORMATION_SCHEMA` view run in the region that you specify, which means that you can't write a single query to join data from views in different regions. To combine `INFORMATION_SCHEMA` views from multiple regions, read and combine the query results locally, or [copy](https://docs.cloud.google.com/bigquery/docs/managing-tables.md.txt#copy_tables_across_regions) the resulting tables to a common region.

### Project qualifier

When present, a project qualifier restricts results to the specified project.
For example:

```googlesql
-- Returns metadata for the specified project and region.
SELECT * FROM myProject.`region-us`.INFORMATION_SCHEMA.TABLES;

-- Returns metadata for the specified project and dataset.
SELECT * FROM myProject.myDataset.INFORMATION_SCHEMA.TABLES;
```

All `INFORMATION_SCHEMA` views support project qualifiers. If a project
qualifier is not specified, the view will default to the
project in which the query is executing.

Specifying a project qualifier for organization-level views
(for example, `STREAMING_TIMELINE_BY_ORGANIZATION`)
has no impact on the results.

## Limitations

- BigQuery `INFORMATION_SCHEMA` queries must be in GoogleSQL syntax. `INFORMATION_SCHEMA` does not support legacy SQL.
- `INFORMATION_SCHEMA` query results are not cached.
- `INFORMATION_SCHEMA` views cannot be used in DDL statements.
- `INFORMATION_SCHEMA` views don't contain information about [hidden datasets](https://docs.cloud.google.com/bigquery/docs/datasets.md.txt#hidden_datasets).
- `INFORMATION_SCHEMA` queries with region qualifiers might include metadata from resources in that region from [deleted datasets that are within your time travel window](https://docs.cloud.google.com/bigquery/docs/restore-deleted-datasets.md.txt).
- When you list resources from an `INFORMATION_SCHEMA` view, the permissions are checked only at the parent level, not at an individual row level. Therefore, any [deny policy](https://docs.cloud.google.com/bigquery/docs/control-access-to-resources-iam.md.txt#deny_access_to_a_resource) that conditionally targets an individual row using tags is ignored.

## What's next

- [Get table information](https://docs.cloud.google.com/bigquery/docs/tables.md.txt#get_table_information_using_information_schema).
- [View Iceberg-managed table metadata](https://docs.cloud.google.com/bigquery/docs/biglake-iceberg-tables-in-bigquery.md.txt#view-iceberg-table-metadata-snapshot).
- [View graph schemas](https://docs.cloud.google.com/bigquery/docs/graph-schema-overview.md.txt#view_graph_schemas).
- [Monitor jobs](https://docs.cloud.google.com/bigquery/docs/admin-jobs-explorer.md.txt).
- [Troubleshoot with information schema](https://docs.cloud.google.com/bigquery/docs/info-schema-troubleshoot.md.txt).