REFRESH updates the stored query results of a materialized view.
CockroachDB does not support materialized views that are refreshed on .
Required privileges
The user must be the of the materialized view or have privileges.Synopsis
Parameters
| Parameter | Description |
|---|---|
opt\_concurrently | CONCURRENTLY (Default behavior) This keyword has no effect. It is present for PostgreSQL compatibility. All materialized views are refreshed concurrently with other jobs. |
view\_name | The name of the materialized view to refresh. |
opt\_clear\_data | WITH DATA (Default behavior) Refresh the stored query results. WITH NO DATA Drop the query results of the materialized view from storage. |
Example
The following example uses the , populated with some workload values. Suppose that you create a materialized view on thebank table:
balance values of the bank table:
SELECT statement against the table:
overdrawn_accounts returns stored results, which are outdated:

