Description
completely replaces the contents of a materialized view. The old contents are discarded. To run this command you must be the owner of the materialized view. With the default, WITH DATA
, the materialized view query is run to provide the new data, and the materialized view is left in a scannable state. If WITH NO DATA
is specified, no new data is generated and the materialized view is left in an unscannable state. A query returns an error if the query attempts to access the materialized view.
CONCURRENTLY
Refresh the materialized view without locking out concurrent selects on the materialized view. Without this option, a refresh that affects a lot of rows tends to use fewer resources and completes more quickly, but could block other connections which are trying to read from the materialized view. This option might be faster in cases where a small number of rows are affected.
This option is only allowed if there is at least one UNIQUE
index on the materialized view which uses only column names and includes all rows; that is, it must not index on any expressions nor include a WHERE
clause.
This option cannot be used when the materialized view is not already populated, and it cannot be used with the WITH NO DATA
clause.
name
The name (optionally schema-qualified) of the materialized view to refresh.
WITH [ NO ] DATA
WITH DATA
is the default and specifies that the materialized view query is run to provide new data, and the materialized view is left in a scannable state. If WITH NO DATA
is specified, no new data is generated and the materialized view is left in an unscannable state. An error is returned if a query attempts to access an unscannable materialized view.
WITH NO DATA
cannot be used with CONCURRENTLY
.
Notes
This command replaces the contents of the materialized view order_summary
using the query from the materialized view’s definition, and leaves it in a scannable state.
This command frees storage associated with the materialized view annual_statistics_basis
and leaves it in an unscannable state.
Compatibility
is a Greenplum Database extension of the SQL standard.
Parent topic: SQL Commands