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 have the on the materialized view. The of the materialized view and users with privileges implicitly have this privilege. To allow a non-owner to refresh a materialized view, runGRANT MAINTAIN ON <materialized-view> TO <role_or_user>;.
Synopsis
Parameters
Examples
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:
Refresh a materialized view with historical data using AS OF SYSTEM TIME
You can refresh a materialized view using historical data with the clause. This is useful for reducing by performing a when refreshing the view.
Historical data is available only within the .

