REFRESH MATERIALIZED VIEW
Overview
Manually triggers a full recomputation of a materialized view, completely rebuilding the data from the source tables and resetting the materialized view status to valid. A materialized view is automatically invalidated after DML changes to its source tables. Running this command restores its ability to participate in query rewriting.
Syntax
Parameters
<schema_name>: Optional. Specifies the schema name; defaults to the current schema if omitted.<mv_name>: The name of the materialized view to refresh.
Examples
Notes
- This performs a full recomputation. When source tables are large, this consumes significant compute resources. It is recommended to run this during off-peak hours.
- A materialized view is automatically invalidated after INSERT, UPDATE, or DELETE operations on its source tables. While invalidated, it can still be queried directly but does not participate in query rewriting.
Related Documentation
- REFRESH DYNAMIC TABLE — refresh a dynamic table
- CREATE MATERIALIZED VIEW
- ALTER MATERIALIZED VIEW — pause/resume automatic refresh scheduling
