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

# REFRESH MATERIALIZED VIEW

> REFRESH MATERIALIZED VIEW manually refreshes a specific asynchronous materialized view or partitions within.

REFRESH MATERIALIZED VIEW manually refreshes a specific asynchronous materialized view or partitions within.

> **CAUTION**
>
> You can only manually refresh materialized views that adopt ASYNC or MANUAL refresh strategy. You can check the refresh strategy of an asynchronous materialized view using [SHOW MATERIALIZED VIEWS](/documents/4.2/sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW.md).
> This operation requires the REFRESH privilege on the target materialized view.

## Syntax

```SQL theme={null}
REFRESH MATERIALIZED VIEW [database.]mv_name
[PARTITION START ("<partition_start_date>") END ("<partition_end_date>")]
[FORCE]
[WITH { SYNC | ASYNC } MODE]
```

## Parameters

| **Parameter** | **Required** | **Description** |
| - | - | - |
| mv\_name | yes | The name of the materialized view to refresh manually. |
| PARTITION START () END () | no | Manually refresh partitions within a certain time interval. |
| partition\_start\_date | no | The start date of the partitions to refresh manually. |
| partition\_end\_date | no | The end date of the partitions to refresh manually. |
| FORCE | no | If you specify this parameter, the database forcibly refreshes the corresponding materialized view or partitions. If you do not specify this parameter, the database automatically judges if the data is updated and refreshes the partition only when needed. |
| WITH ... MODE | no | Make a synchronous or asynchronous call of the refresh task. `SYNC` indicates making a synchronous call of the refresh task, and the database returns the task result only when the task succeeds or fails. `ASYNC` indicates making an asynchronous call of the refresh task, and the database returns success right after the task is submitted, leaving the task to be executed asynchronously in the background. You can check the refresh task status of an asynchronous materialized view by querying the `tasks` and `task_runs` metadata views in the database' Information Schema. For more information, see [Check the execution status of asynchronous materialized view](/documents/4.2/using_starrocks/async_mv/Materialized_view.md#check-the-execution-status-of-asynchronous-materialized-view). Default: `ASYNC`. Supported from v2.5.8 and v3.1.0 onwards. |

> **CAUTION**
>
> When refreshing materialized views created based on the external catalogs, the database refreshes all partitions in the materialized views.

## Monitoring

After executing `REFRESH MATERIALIZED VIEW`, you can monitor the status and result of the refresh operation in the following ways:

* Execute [`SHOW MATERIALIZED VIEWS`](/documents/4.2/sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW) to view the status of the materialized view, including the last refresh time, refresh state, and any error messages.
* For more detailed execution information, especially for asynchronous refresh tasks, query the system view [`information_schema.task_runs`](/documents/4.2/sql-reference/information_schema/task_runs). This view provides task execution records and states (PENDING, RUNNING, SUCCESS, FAILED). For materialized view refreshes, the `EXTRA_MESSAGE` field includes detailed information about the partitions and execution details for each refresh sub-task. See [Understand Materialized View Task Runs](/documents/4.2/using_starrocks/async_mv/materialized_view_task_run_details.md) for details.

## Examples

Example 1: Manually refresh a specific materialized view via an asynchronous call.

```Plain theme={null}
REFRESH MATERIALIZED VIEW lo_mv1;

REFRESH MATERIALIZED VIEW lo_mv1 WITH ASYNC MODE;
```

Example 2: Manually refresh certain partitions of a specific materialized view.

```Plain theme={null}
REFRESH MATERIALIZED VIEW lo_mv1 
PARTITION START ("2020-02-01") END ("2020-03-01");
```

Example 3: Forcibly refresh certain partitions of a specific materialized view.

```Plain theme={null}
REFRESH MATERIALIZED VIEW lo_mv1
PARTITION START ("2020-02-01") END ("2020-03-01") FORCE;
```

Example 4: Manually refresh a materialized view via a synchronous call.

```Plain theme={null}
REFRESH MATERIALIZED VIEW lo_mv1 WITH SYNC MODE;
```


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