From 6eb9c5a5657d1fe77b55cc261450f3538d35a94d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:19:15 +0200 Subject: Adding upstream version 13.4. Signed-off-by: Daniel Baumann --- doc/src/sgml/ref/refresh_materialized_view.sgml | 145 ++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 doc/src/sgml/ref/refresh_materialized_view.sgml (limited to 'doc/src/sgml/ref/refresh_materialized_view.sgml') diff --git a/doc/src/sgml/ref/refresh_materialized_view.sgml b/doc/src/sgml/ref/refresh_materialized_view.sgml new file mode 100644 index 0000000..8ae6267 --- /dev/null +++ b/doc/src/sgml/ref/refresh_materialized_view.sgml @@ -0,0 +1,145 @@ + + + + + REFRESH MATERIALIZED VIEW + + + + REFRESH MATERIALIZED VIEW + 7 + SQL - Language Statements + + + + REFRESH MATERIALIZED VIEW + replace the contents of a materialized view + + + + +REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] name + [ WITH [ NO ] DATA ] + + + + + Description + + + REFRESH MATERIALIZED VIEW completely replaces the + contents of a materialized view. To execute this command you must be the + owner of the materialized view. The old contents are discarded. If + WITH DATA is specified (or defaults) the backing query + is executed 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. + + + CONCURRENTLY and WITH NO DATA may not + be specified together. + + + + + Parameters + + + + CONCURRENTLY + + + Refresh the materialized view without locking out concurrent selects on + the materialized view. Without this option a refresh which affects a + lot of rows will tend to use fewer resources and complete more quickly, + but could block other connections which are trying to read from the + materialized view. This option may 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 be an + expression index or include a WHERE clause. + + + This option may not be used when the materialized view is not already + populated. + + + Even with this option only one REFRESH at a time may + run against any one materialized view. + + + + + + name + + + The name (optionally schema-qualified) of the materialized view to + refresh. + + + + + + + + Notes + + + While the default index for future + + operations is retained, REFRESH MATERIALIZED VIEW does not + order the generated rows based on this property. If you want the data + to be ordered upon generation, you must use an ORDER BY + clause in the backing query. + + + + + Examples + + + This command will replace the contents of the materialized view called + order_summary using the query from the materialized + view's definition, and leave it in a scannable state: + +REFRESH MATERIALIZED VIEW order_summary; + + + + + This command will free storage associated with the materialized view + annual_statistics_basis and leave it in an unscannable + state: + +REFRESH MATERIALIZED VIEW annual_statistics_basis WITH NO DATA; + + + + + Compatibility + + + REFRESH MATERIALIZED VIEW is a + PostgreSQL extension. + + + + + See Also + + + + + + + + + -- cgit v1.2.3