> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# materialized_views

> materialized_views provides information about all materialized views.

`materialized_views` provides information about all materialized views.

The following fields are provided in `materialized_views`:

| **Field** | **Description** |
| - | - |
| MATERIALIZED\_VIEW\_ID | ID of the materialized view. |
| TABLE\_SCHEMA | Database in which the materialized view resides. |
| TABLE\_NAME | Name of the materialized view. |
| REFRESH\_TYPE | Refresh type of the materialized view. Valid values: `SYNC` (synchronous materialized view) and `ASYNC` (asynchronous materialized view, regardless of how the refresh is triggered). When the value is `SYNC`, all fields related to activation status and refresh are empty. See `REFRESH_TRIGGER` and `REFRESH_POLICY` for how an asynchronous materialized view is refreshed. |
| IS\_ACTIVE | Indicates whether the materialized view is active. Inactive materialized views cannot be refreshed or queried. |
| INACTIVE\_REASON | The reason that the materialized view is inactive. |
| PARTITION\_TYPE | Type of partitioning strategy for the materialized view. |
| TASK\_ID | ID of the task responsible for refreshing the materialized view. |
| TASK\_NAME | Name of the task responsible for refreshing the materialized view. |
| LAST\_REFRESH\_START\_TIME | Start time of the most recent refresh task. |
| LAST\_REFRESH\_FINISHED\_TIME | End time of the most recent refresh task. |
| LAST\_REFRESH\_DURATION | Wall-clock duration of the most recent refresh, in seconds (the last task run's finish time minus the first task run's process-start time). Matches `materialized_view_refresh_jobs.DURATION_TIME` for that job. |
| LAST\_REFRESH\_STATE | State of the most recent refresh task. |
| LAST\_REFRESH\_FORCE\_REFRESH | Indicates whether the most recent refresh task was a force refresh. |
| LAST\_REFRESH\_START\_PARTITION | Starting partition for the most recent refresh task. |
| LAST\_REFRESH\_END\_PARTITION | Ending partition for the most recent refresh task. |
| LAST\_REFRESH\_BASE\_REFRESH\_PARTITIONS | Base table partitions involved in the most recent refresh task. |
| LAST\_REFRESH\_MV\_REFRESH\_PARTITIONS | Materialized view partitions refreshed in the most recent refresh task. |
| LAST\_REFRESH\_ERROR\_CODE | Error code of the most recent refresh task. |
| LAST\_REFRESH\_ERROR\_MESSAGE | Error message of the most recent refresh task. |
| TABLE\_ROWS | Number of data rows in the materialized view, based on approximate background statistics. |
| MATERIALIZED\_VIEW\_DEFINITION | SQL definition of the materialized view. |
| EXTRA\_MESSAGE | Extra message of the materialized view. |
| QUERY\_REWRITE\_STATUS | Query rewrite status of the materialized view. |
| CREATOR | Creator of the materialized view. |
| LAST\_REFRESH\_PROCESS\_TIME | Process time of the most recent refresh task. |
| LAST\_REFRESH\_JOB\_ID | Job ID of the most recent refresh task. |
| LAST\_REFRESH\_TIME | Time up to which base table updates are reflected in the materialized view. |
| WAREHOUSE | Name of the warehouse that the asynchronous materialized view uses for its refresh tasks. Empty in shared-nothing mode, or for synchronous (rollup) materialized views. |
| REFRESH\_MODE | Configured refresh mode of the asynchronous materialized view. Valid values are `PCT` (partition change tracking, where only changed partitions are refreshed), `INCREMENTAL` (incremental view maintenance), and `AUTO` (automatic mode selection). Empty for synchronous materialized views. |
| REFRESH\_TRIGGER | How a refresh is triggered. Valid values: `NONE` (synchronous materialized view), `MANUAL` (only via REFRESH MATERIALIZED VIEW), `SCHEDULED` (periodic, via an EVERY interval), and `ON_BASE_TABLE_CHANGE` (automatically when a base table loads or changes). |
| REFRESH\_POLICY | Human-readable refresh policy. Valid values: `NONE`, `MANUAL`, `ON_BASE_TABLE_CHANGE`, or a schedule such as `START("yyyy-MM-dd HH:mm:ss") EVERY(INTERVAL n unit)` (the `START` clause is present only if a start time was defined). |
| RESOURCE\_GROUP | Resource group used for the materialized view's refresh tasks (from the materialized view's `resource_group` property). Defaults to `default_mv_wg` when not set. |
| QUERY\_REWRITE\_STATUS\_REASON | The reason behind `QUERY_REWRITE_STATUS`. Valid values: `OK`, `MV_INACTIVE`, `QUERY_REWRITE_DISABLED`, `UNSUPPORTED_DEFINITION`, and `UNKNOWN`. |
| LAST\_FRESHNESS\_CONFIRMED\_AT | Start time of the most recent successful refresh, recorded once the entire refresh (all of its task runs) completes; a refresh that found no base-table changes to apply also confirms freshness. The materialized view reflects base-table data as of this moment. Unlike `LAST_REFRESH_TIME` (the base-table data version), this is wall-clock time. `NULL` until the first successful refresh, and for synchronous materialized views. A partition-scoped (partial) REFRESH does not advance it. |
| BASE\_TABLE\_REFRESH\_VERSION\_TIMES | Per-base-table data version time, as a JSON object mapping each base table's `catalog.database.table` name to the latest data version time observed for it. This is the per-table detail behind `LAST_REFRESH_TIME` (their single maximum): external/data lake base tables report the partition source modified time, and OLAP (internal) base tables report the visible-version commit time. `{}` when no base table has a recorded time. This column only advances on a successful refresh (a failed or skipped refresh leaves it unchanged). Its resolution is one second, so a write and a refresh landing in the same second are indistinguishable. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.