From d62ab471136c3eee503cd2a88d5081366466fa6a Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Mon, 23 Jan 2023 11:45:28 +0100 Subject: [PATCH 1/4] Document MV GRACE PERIOD clause --- .../src/main/sphinx/sql/create-materialized-view.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/src/main/sphinx/sql/create-materialized-view.rst b/docs/src/main/sphinx/sql/create-materialized-view.rst index 62fd1a785c72..aecbd6e276f3 100644 --- a/docs/src/main/sphinx/sql/create-materialized-view.rst +++ b/docs/src/main/sphinx/sql/create-materialized-view.rst @@ -9,6 +9,7 @@ Synopsis CREATE [ OR REPLACE ] MATERIALIZED VIEW [ IF NOT EXISTS ] view_name + [ GRACE PERIOD interval ] [ COMMENT string ] [ WITH properties ] AS query @@ -29,16 +30,19 @@ materialized views, as compared to each time of accessing the view. Multiple reads of view data over time, or by multiple users, all trigger repeated processing. This is avoided for materialized views. -When the underlying data changes, the materialized view becomes out of sync with -the source tables. Update the data in the materialized view with the -:doc:`refresh-materialized-view` statement. - The optional ``OR REPLACE`` clause causes the materialized view to be replaced if it already exists rather than raising an error. The optional ``IF NOT EXISTS`` clause causes the materialized view only to be created or replaced if it does not exist yet. +The optional ``GRACE PERIOD`` clause specified how long the query materialization +should be used for querying. If time elapsed since last materialized view refresh +is greater than the grace period, the materialized view acts as a normal view and +materialized data is not used. If not specified, the grace period defaults to +infinity. See :doc:`refresh-materialized-view` for more about refreshing +materialized views. + The optional ``COMMENT`` clause causes a ``string`` comment to be stored with the metadata about the materialized view. The comment is displayed with the :doc:`show-create-materialized-view` statement and is available in the table From b975033a235d9ba51a8fd114e37ba4a11e876e6e Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Tue, 24 Jan 2023 17:08:10 +0100 Subject: [PATCH 2/4] Update docs/src/main/sphinx/sql/create-materialized-view.rst Co-authored-by: Manfred Moser --- docs/src/main/sphinx/sql/create-materialized-view.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/sphinx/sql/create-materialized-view.rst b/docs/src/main/sphinx/sql/create-materialized-view.rst index aecbd6e276f3..a06b07e58d01 100644 --- a/docs/src/main/sphinx/sql/create-materialized-view.rst +++ b/docs/src/main/sphinx/sql/create-materialized-view.rst @@ -36,7 +36,7 @@ if it already exists rather than raising an error. The optional ``IF NOT EXISTS`` clause causes the materialized view only to be created or replaced if it does not exist yet. -The optional ``GRACE PERIOD`` clause specified how long the query materialization +The optional ``GRACE PERIOD`` clause specifies how long the query materialization should be used for querying. If time elapsed since last materialized view refresh is greater than the grace period, the materialized view acts as a normal view and materialized data is not used. If not specified, the grace period defaults to From c265175f6d55fc70ab91452b0704a520100c0584 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Tue, 24 Jan 2023 17:08:31 +0100 Subject: [PATCH 3/4] Update docs/src/main/sphinx/sql/create-materialized-view.rst Co-authored-by: Manfred Moser --- docs/src/main/sphinx/sql/create-materialized-view.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/sphinx/sql/create-materialized-view.rst b/docs/src/main/sphinx/sql/create-materialized-view.rst index a06b07e58d01..4bdd4655fe02 100644 --- a/docs/src/main/sphinx/sql/create-materialized-view.rst +++ b/docs/src/main/sphinx/sql/create-materialized-view.rst @@ -37,7 +37,7 @@ The optional ``IF NOT EXISTS`` clause causes the materialized view only to be created or replaced if it does not exist yet. The optional ``GRACE PERIOD`` clause specifies how long the query materialization -should be used for querying. If time elapsed since last materialized view refresh +is used for querying. If the time elapsed since last materialized view refresh is greater than the grace period, the materialized view acts as a normal view and materialized data is not used. If not specified, the grace period defaults to infinity. See :doc:`refresh-materialized-view` for more about refreshing From 630baf35dddbd2b7df16750c80ec82e4cb202874 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Tue, 24 Jan 2023 17:08:39 +0100 Subject: [PATCH 4/4] Update docs/src/main/sphinx/sql/create-materialized-view.rst Co-authored-by: Manfred Moser --- docs/src/main/sphinx/sql/create-materialized-view.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/sphinx/sql/create-materialized-view.rst b/docs/src/main/sphinx/sql/create-materialized-view.rst index 4bdd4655fe02..b2dd6526fde3 100644 --- a/docs/src/main/sphinx/sql/create-materialized-view.rst +++ b/docs/src/main/sphinx/sql/create-materialized-view.rst @@ -39,7 +39,7 @@ created or replaced if it does not exist yet. The optional ``GRACE PERIOD`` clause specifies how long the query materialization is used for querying. If the time elapsed since last materialized view refresh is greater than the grace period, the materialized view acts as a normal view and -materialized data is not used. If not specified, the grace period defaults to +the materialized data is not used. If not specified, the grace period defaults to infinity. See :doc:`refresh-materialized-view` for more about refreshing materialized views.