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

# materialized_view_refresh_jobs

> materialized_view_refresh_jobs provides job-level information about materialized view refreshes.

`materialized_view_refresh_jobs` provides job-level information about materialized view refreshes.

A single refresh job may comprise multiple task runs (for example, partition-by-partition refresh batches); this view rolls those task runs up into one row per job. It shares its data source with [`task_runs`](/documents/4.2/sql-reference/information_schema/task_runs), so you can use `JOB_ID` to drill down into the individual task runs of a job (`SELECT * FROM information_schema.task_runs WHERE JOB_ID = '<job_id>'`), and job records are retained for the same window as `task_runs` history.

The following fields are provided in `materialized_view_refresh_jobs`:

| **Field** | **Description** |
| - | - |
| JOB\_ID | ID of the refresh job. All task runs of one refresh share this ID; use it to drill down into `task_runs.JOB_ID`. |
| MATERIALIZED\_VIEW\_ID | ID of the materialized view. |
| TABLE\_SCHEMA | Database the materialized view belongs to. |
| TABLE\_NAME | Name of the materialized view. `NULL` if the materialized view has been dropped. |
| TASK\_ID | ID of the refresh task. |
| WAREHOUSE | Warehouse used by the refresh job. |
| RESOURCE\_GROUP | Resource group used by the refresh job. This is the materialized view's configured `resource_group` property; returns `default_mv_wg` when not configured. |
| CREATOR | User that created the materialized view (its create-user; the run identity is in RUN\_AS\_USER). |
| SUBMIT\_USER | User who submitted the refresh job. For a manual refresh this is the user who issued it; for scheduled or base-table-change refreshes it is submitted by the system. |
| RUN\_AS\_USER | User identity the refresh runs as. With creator-based authorization (the default, `mv_use_creator_based_authorization=true`) this is the materialized view's creator; with root-based authorization it is `'root'@'%'`. |
| SUBMIT\_TIME | Time when the job was submitted (the first task run's creation time). |
| REFRESH\_STATE | State of the job, rolled up from the last task run. Valid values: `PENDING`, `RUNNING`, `FAILED`, `SUCCESS`, and `SKIPPED`. |
| FINISH\_TIME | Time when the job finished. `NULL` if the job has not finished. |
| DURATION\_TIME | Wall-clock duration of the job, in seconds (the last task run's finish time minus the first task run's process-start time). `NULL` if the job has not finished. |
| REFRESH\_TRIGGER | How this job was triggered. `MANUAL` for a manually-issued `REFRESH MATERIALIZED VIEW` (even when the materialized view's scheme is scheduled or automatic); otherwise the materialized view's configured scheme. Valid values: `MANUAL`, `SCHEDULED`, `ON_BASE_TABLE_CHANGE`, and `NONE`. `UNKNOWN` if the materialized view has been dropped and the job was not manual. |
| REFRESH\_MODE | The materialized view's configured refresh mode. Valid values: `PCT` and `INCREMENTAL`. `NULL` if the materialized view has been dropped. Note that this is the *configured* mode, not the mode a given refresh actually ran in: they differ for the bootstrap refresh and whenever INCREMENTAL planning fails and falls back to PCT. For the mode a refresh actually ran in, query `get_json_string(EXTRA_MESSAGE, '$.refreshMode')` on `information_schema.task_runs`. |
| IMV\_SOURCE\_VERSION\_RANGE | JSON of the source version ranges an incremental refresh worked from, one entry per base table. A range whose `start` equals its `end` means that base table had no change, so a refresh skipped because nothing changed reports such a range for every base table. Returns `NULL` for a non-incremental (PCT) refresh. |
| IMV\_SOURCE\_TIMESTAMP\_RANGE | JSON of the commit times of the same range endpoints as IMV\_SOURCE\_VERSION\_RANGE. Returns `NULL` for a non-incremental (PCT) refresh, and also for an incremental refresh whose endpoint commit times could not be resolved. |
| IMV\_SOURCE\_PINNED\_SNAPSHOT\_ID\_MAP | JSON of pinned source snapshot IDs, keyed by the base table's `<catalog>.<db>.<table>` name — the same key IMV\_SOURCE\_VERSION\_RANGE and IMV\_SOURCE\_TIMESTAMP\_RANGE use, so the three can be joined per base table. Populated on the baseline/PCT-path refresh; returns `NULL` on a pure incremental run or when no snapshot was pinned. |
| FAILED\_TASK\_RUN\_ID | Task-run ID of the failed run within the job. `NULL` if no run failed. To drill down into `task_runs`, join on `FAILED_QUERY_ID = task_runs.QUERY_ID` (or on `JOB_ID`); `task_runs` does not expose a task-run-id column. |
| FAILED\_QUERY\_ID | Query ID of the failed run. `NULL` if no run failed. |
| ERROR\_CODE | Error code of the failed run. `NULL` if no run failed. |
| ERROR\_MESSAGE | Error message of the failed run. `NULL` if no run failed. |

**Note**

This view has no persistent storage. Its rows are derived from `task_runs` at query time, so record retention follows the `task_runs` history settings. Because each job is aggregated from its `task_runs` rows at query time, a job is only fully represented while all of its task runs are still within the `task_runs` history window; older jobs are not shown, and a job straddling the retention boundary may be partially aggregated (for example, its `SUBMIT_TIME` or `IMV_SOURCE_*` range may reflect only the retained runs).


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