This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 54e8354fc69e69195f2d4c5f3eb2f2f0c0180daf Author: zhangdong <493738...@qq.com> AuthorDate: Tue Feb 20 10:59:13 2024 +0800 [doc](mtmv) Update the mtmv documentation to make it consistent with the code (#30899) --- .../async-materialized-view/async-materialized-view.md | 5 +++++ .../Create/CREATE-ASYNC-MATERIALIZED-VIEW.md | 9 +++++---- .../async-materialized-view/async-materialized-view.md | 5 +++++ .../Create/CREATE-ASYNC-MATERIALIZED-VIEW.md | 8 +++++--- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/en/docs/query-acceleration/async-materialized-view/async-materialized-view.md b/docs/en/docs/query-acceleration/async-materialized-view/async-materialized-view.md index a3cbf880051..e2f35c0e3f3 100644 --- a/docs/en/docs/query-acceleration/async-materialized-view/async-materialized-view.md +++ b/docs/en/docs/query-acceleration/async-materialized-view/async-materialized-view.md @@ -206,3 +206,8 @@ Specific syntax can be viewed [DROP MATERIALIZED VIEW](../../sql-manual/sql-refe ## The use of materialized views can be viewed [Query async materialized view](./query-async-materialized-view.md) + +## Notice + +- Asynchronous materialized views are only supported for use in the Nereids optimizer, [Nereids optimizer](../nereids.md) +- Currently, determining the synchronization between materialized views and base tables is only supported for `OlapTable`. For other types of external tables, they are directly considered to be synchronized. For instance, if the base tables of a materialized view are all external tables, they are assumed to be synchronized. When querying `mv_infos()`, the SyncWithBaseTables flag will always return 1 (true) for these external tables. When refreshing a materialized view, it is necessary to [...] \ No newline at end of file diff --git a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md index 31450326d7a..37156bc7011 100644 --- a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -160,8 +160,7 @@ KEY(k1,k2) ``` ##### partition -There are two partition methods for materialized views. If no partition is specified, there is only one partition by default. If a partition field is specified, -it will automatically deduce which base table the field comes from and synchronize all partitions of the base table (constraint: the base table can only have one partition field and cannot allow null values) +There are two types of partitioning methods for materialized views. If no partitioning is specified, there will be a default single partition. If a partitioning field is specified, the system will automatically deduce the source base table of that field and synchronize all partitions of the base table (currently supporting `OlapTable` and `hive`). (Limitation: the current base table can only have one partitioning field.) For example, if the base table is a range partition with a partition field of `create_time` and partitioning by day, and `partition by(ct) as select create_time as ct from t1` is specified when creating a materialized view, then the materialized view will also be a range partition with a partition field of 'ct' and partitioning by day @@ -171,11 +170,13 @@ The materialized view can specify both the properties of the table and the prope The properties unique to materialized views include: -`grace_period`: Maximum delay time allowed for materialized view data during query rewriting +`grace_period`: When performing query rewrites, there is a maximum allowed delay time (measured in seconds) for the data of the materialized view. If there is a discrepancy between the data of partition A and the base table, and the last refresh time of partition A of the materialized view was 1, while the current system time is 2, then this partition will not undergo transparent rewriting. However, if the grace_period is greater than or equal to 1, this partition will be used for transp [...] `excluded_trigger_tables`: Table names ignored during data refresh, separated by commas. For example, ` table1, table2` -`refresh_partition_num`: The number of partitions refreshed in a single insert statement, defaults to 1 +`refresh_partition_num`: The number of partitions refreshed by a single insert statement is set to 1 by default. When refreshing a materialized view, the system first calculates the list of partitions to be refreshed and then splits it into multiple insert statements that are executed in sequence according to this configuration. If any insert statement fails, the entire task will stop executing. The materialized view ensures the transactionality of individual insert statements, meaning t [...] + +`workload_group`: The name of the workload_group used by the materialized view when performing refresh tasks. This is used to limit the resources used for refreshing data in the materialized view, in order to avoid affecting the operation of other business processes. For details on how to create and use workload_group, refer to [WORKLOAD-GROUP](../../../../admin-manual/workload-group.md) ##### query diff --git a/docs/zh-CN/docs/query-acceleration/async-materialized-view/async-materialized-view.md b/docs/zh-CN/docs/query-acceleration/async-materialized-view/async-materialized-view.md index 95a684df070..6f21206f02b 100644 --- a/docs/zh-CN/docs/query-acceleration/async-materialized-view/async-materialized-view.md +++ b/docs/zh-CN/docs/query-acceleration/async-materialized-view/async-materialized-view.md @@ -207,3 +207,8 @@ DROP MATERIALIZED VIEW mv1; 请参阅 [查询异步物化视图](./query-async-materialized-view.md) +## 注意事项 + +- 异步物化视图仅支持在Nereids优化器使用,[Nereids优化器](../nereids.md) +- 当前判断物化视图和基表是否同步仅支持`OlapTable`。对于其它外表,会直接认为是同步的。例如,物化视图的基表全是外表。在查询`mv_infos()`时,SyncWithBaseTables会永远为1(true)。在刷新物化视图时需要手动刷新指定的分区或指定`complete`刷新全部分区 + diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md index 7be195589a8..8add74079bf 100644 --- a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -160,7 +160,7 @@ KEY(k1,k2) ``` ##### partition -物化视图有两种分区方式,如果不指定分区,默认只有一个分区,如果指定分区字段,会自动推导出字段来自哪个基表并同步基表的所有分区(限制条件:基表只能有一个分区字段且不能允许空值) +物化视图有两种分区方式,如果不指定分区,默认只有一个分区,如果指定分区字段,会自动推导出字段来自哪个基表并同步基表(当前支持`OlapTable`和`hive`)的所有分区(限制条件:当前基表只能有一个分区字段) 例如:基表是range分区,分区字段为`create_time`并按天分区,创建物化视图时指定`partition by(ct) as select create_time as ct from t1` 那么物化视图也会是range分区,分区字段为`ct`,并且按天分区 @@ -170,11 +170,13 @@ KEY(k1,k2) 物化视图特有的property包括: -`grace_period`:查询改写时允许物化视图数据的最大延迟时间 +`grace_period`:查询改写时允许物化视图数据的最大延迟时间(单位:秒)。如果分区A和基表的数据不一致,物化视图的分区A上次刷新时间为1,系统当前时间为2,那么该分区不会被透明改写。但是如果grace_period大于等于1,该分区就会被用于透明改写 `excluded_trigger_tables`:数据刷新时忽略的表名,逗号分割。例如`table1,table2` -`refresh_partition_num`:单次insert语句刷新的分区数量,默认为1 +`refresh_partition_num`:单次insert语句刷新的分区数量,默认为1。物化视图刷新时会先计算要刷新的分区列表,然后根据该配置拆分成多个insert语句顺序执行。遇到失败的insert语句,整个任务将停止执行。物化视图保证单个insert语句的事务性,失败的insert语句不会影响到已经刷新成功的分区。 + +`workload_group`:物化视图执行刷新任务时使用的workload_group名称。用来限制物化视图刷新数据使用的资源,避免影响到其它业务的运行。workload_group创建及使用 [WORKLOAD-GROUP](../../../../admin-manual/workload-group.md) ##### query --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org