You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2025/12/17 10:24:16 UTC
(doris-website) branch master updated: [doc](mtmv)mtmv support view and multi pct tables (#3096)
This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 674c1cab66f [doc](mtmv)mtmv support view and multi pct tables (#3096)
674c1cab66f is described below
commit 674c1cab66f4dc3f64a6389adc1b6f76e73d9ade
Author: zhangdong <49...@qq.com>
AuthorDate: Wed Dec 17 18:24:11 2025 +0800
[doc](mtmv)mtmv support view and multi pct tables (#3096)
---
.../functions-and-demands.md | 30 ++++++-
.../async-materialized-view/use-guide.md | 94 ---------------------
.../functions-and-demands.md | 29 ++++++-
.../async-materialized-view/use-guide.md | 95 ----------------------
.../functions-and-demands.md | 2 +-
.../functions-and-demands.md | 2 +-
.../functions-and-demands.md | 29 ++++++-
.../async-materialized-view/use-guide.md | 95 ----------------------
.../functions-and-demands.md | 2 +-
.../functions-and-demands.md | 2 +-
.../functions-and-demands.md | 30 ++++++-
.../async-materialized-view/use-guide.md | 94 ---------------------
12 files changed, 118 insertions(+), 386 deletions(-)
diff --git a/docs/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/docs/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index 99bcbd4eb74..6c090e7471f 100644
--- a/docs/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/docs/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -462,8 +462,36 @@ Additionally, if the partition field is of string type, the date format can be s
For more details, refer to [CREATE ASYNC MATERIALIZED VIEW](../../../sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW).
+#### Multi-PCT Refresh
+"Multi-PCT Refresh" allows asynchronous materialized views to have multiple partition change tracking (PCT) tables, meaning that when data changes occur in multiple base tables, only partition-level refresh is performed instead of a full refresh.
+
+This feature has the following limitations in usage:
+- Only materialized views built based on INNER JOIN or UNION (including UNION ALL) are supported.
+- When the materialized view uses UNION operations, all participating union components must support Partition Change Tracking (PCT). For example, if the materialized view's SQL definition is: q1 UNION ALL q2, then both q1 and q2 must individually support partition refresh when used alone to create materialized views, and the derived partition columns must have consistent ordering.
+- The partition granularity across multiple PCT tables must be aligned:
+ - **Allowed example**:
+
+ Partitions of base table t1: [2020-01-01, 2020-01-02), [2020-01-02, 2020-01-03)
+
+ Partitions of base table t2: [2020-01-02, 2020-01-03), [2020-01-03, 2020-01-04)
+
+ The partitions of multiple base tables are not completely identical, but they do not overlap.
+
+ - **Disallowed example**:
+
+ Partitions of base table t1: [2020-01-01, 2020-01-03), [2020-01-03, 2020-01-05)
+
+ Partitions of base table t2: [2020-01-01, 2020-01-02), [2020-01-03, 2020-01-05)
+
+ Partitions [2020-01-01, 2020-01-03) and [2020-01-01, 2020-01-02) overlap but are not identical.
+
### SQL Definition
-There are no restrictions on the SQL definition of asynchronous materialized views.
+
+Asynchronous materialized views can be created based on internal views but do not support construction based on views from external data sources.
+
+It is important to note that when the underlying internal views are modified or rebuilt, it may lead to data inconsistencies between the asynchronous materialized view and the base tables. In such cases, although the data in the materialized view still exists, it cannot support transparent query rewriting.
+
+Additionally, if structural changes affect the partition tracking tables or columns relied upon by the asynchronous materialized view, or cause changes to its schema, the materialized view will fail to refresh successfully. If the changes do not impact these elements, the materialized view can resume normal operation after a refresh.
## Direct Querying of Materialized Views
diff --git a/docs/query-acceleration/materialized-view/async-materialized-view/use-guide.md b/docs/query-acceleration/materialized-view/async-materialized-view/use-guide.md
index af3c0931fdd..ffbebb4280a 100644
--- a/docs/query-acceleration/materialized-view/async-materialized-view/use-guide.md
+++ b/docs/query-acceleration/materialized-view/async-materialized-view/use-guide.md
@@ -164,100 +164,6 @@ GROUP BY
date_trunc(l_ordertime, 'day');
```
-## Creating Partitioned Materialized Views with UNION ALL
-Currently, Doris has a limitation where partitioned materialized view definitions cannot contain UNION ALL clauses.
-To create a materialized view that includes UNION ALL, you can use the following approach: For each input part of the UNION ALL,
-attempt to create a partitioned materialized view, and then create a regular view for the entire UNION ALL result set.
-
-For example:
-The materialized view definition below contains a UNION ALL clause, which cannot be directly used to create a partitioned materialized view.
-
-```sql
-
-SELECT
-l_linestatus,
-sum(
-l_extendedprice * (1 - l_discount)
-) AS revenue,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey
-GROUP BY
-l_linestatus,
-ps_partkey,
-date_trunc(l_ordertime, 'day')
-UNION ALL
-SELECT
-l_linestatus,
-l_extendedprice,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey;
-```
-
-You can split the above SQL statement into two parts and create two partitioned materialized views separately.
-
-```sql
-
-CREATE MATERIALIZED VIEW union_sub_mv1
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-AS
-SELECT
-l_linestatus,
-sum(
-l_extendedprice * (1 - l_discount)
-) AS revenue,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey
-GROUP BY
-l_linestatus,
-ps_partkey,
-date_trunc(l_ordertime, 'day');
-```
-
-```sql
-CREATE MATERIALIZED VIEW union_sub_mv2
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-AS
-SELECT
-l_linestatus,
-l_extendedprice,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey;
-```
-Then create a regular view that performs UNION ALL on the result sets of the two partitioned materialized views.
-This view (union_all_view) can be exposed externally.
-
-```sql
-CREATE VIEW union_all_view
-AS
-SELECT *
-FROM
-union_sub_mv1
-UNION ALL
-SELECT *
-FROM
-union_sub_mv2;
-```
-
## Partitioned Materialized Views Retaining Only Recent Partition Data
:::tip Note
This feature has been supported since Apache Doris version 2.1.1.
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index 02e2bc31642..10c4607f243 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -446,9 +446,36 @@ SELECT * FROM t1;
详情参考 [CREATE ASYNC MATERIALIZED VIEW](../../../sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW)
+#### 分区多端刷新
+“多端刷新” 允许异步物化视图有多个分区追踪表,即允许多个表的数据发生变化,物化视图都只进行分区刷新,而不是全量刷新。
+
+该特性在使用中存在以下限制:
+- 仅支持基于 INNER JOIN 或 UNION (包括 UNION ALL) 所构建的物化视图。
+- 当物化视图使用 UNION 操作时,所有参与联合的部分都必须支持分区变化追踪(PCT)。 例如物化视图的 sql 定义为:q1 union all q2, 那么要求单独使用 q1 或 q2 创建物化视图都能进行分区刷新,且推导出的分区字段的顺序一致。
+- 多 PCT 表间的分区粒度要对齐
+ - 允许的示例:
+
+ 基表 t1 的分区:[2020-01-01, 2020-01-02), [2020-01-02, 2020-01-03)
+
+ 基表 t2 的分区:[2020-01-02, 2020-01-03), [2020-01-03, 2020-01-04)
+
+ 多个基表的分区不完全一致,但是没有交叉
+
+ - 不允许的示例:
+
+ 基表 t1 的分区:[2020-01-01, 2020-01-03), [2020-01-03, 2020-01-05)
+
+ 基表 t2 的分区:[2020-01-01, 2020-01-02), [2020-01-03, 2020-01-05)
+
+ [2020-01-01, 2020-01-03) 和 [2020-01-01, 2020-01-02) 有交叉又不完全一样
+
### SQL 定义
-异步物化视图 SQL 定义没有限制。
+异步物化视图支持基于内部视图(View)进行创建,但不支持基于外部数据源中的视图构建。
+
+需要注意的是,当所依赖的内部视图发生修改或重建时,会导致异步物化视图与基表之间的数据不一致。此时,虽然物化视图中的数据仍然存在,但无法支持查询的透明改写。
+
+此外,如果结构变更影响了异步物化视图所依赖的分区追踪表或字段,或使其 Schema 发生变化,该物化视图将无法刷新成功。若变更未影响上述元素,则刷新物化视图后,即可恢复正常使用。
## 直查物化视图
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/use-guide.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/use-guide.md
index f1abdaebf6f..206d952e775 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/use-guide.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/use-guide.md
@@ -162,101 +162,6 @@ GROUP BY
date_trunc(l_ordertime, 'day');
```
-## 创建包含 UNION ALL 的分区物化视图
-目前 Doris 有限制,分区物化定义中不能包含 UNION ALL 子句。
-如果想要创建包含 UNION ALL 的物化视图,可以使用采用如下的方式创建。对于 UNION ALL 的每部分输入
-尝试创建分区物化视图,之后针对整个 UNION ALL 结果集创建一个普通视图。
-
-例如:
-物化视图定义如下,要使用如下 sql 语句构建分区物化视图,可以看到 sql 语句包含 UNION ALL 子句。
-```sql
-SELECT
- l_linestatus,
- sum(
- l_extendedprice * (1 - l_discount)
- ) AS revenue,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey
-GROUP BY
- l_linestatus,
- ps_partkey,
- date_trunc(l_ordertime, 'day')
-UNION ALL
-SELECT
- l_linestatus,
- l_extendedprice,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey;
-```
-
-可以将上述 SQL 语句拆分成两个部分,分别创建两个分区物化视图。
-
-```sql
-CREATE MATERIALIZED VIEW union_sub_mv1
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-AS
-SELECT
- l_linestatus,
- sum(
- l_extendedprice * (1 - l_discount)
- ) AS revenue,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey
-GROUP BY
- l_linestatus,
- ps_partkey,
- date_trunc(l_ordertime, 'day');
-```
-
-
-```sql
-CREATE MATERIALIZED VIEW union_sub_mv2
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-
-AS
-SELECT
- l_linestatus,
- l_extendedprice,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey;
-```
-
-然后创建一个普通视图,将两个分区物化视图的结果集进行 UNION ALL。对外可以提供这个视图 union_all_view
-
-```sql
-CREATE VIEW union_all_view
-AS
-SELECT *
-FROM
-union_sub_mv1
-UNION ALL
-SELECT *
-FROM
-union_sub_mv2;
-
-```
-
-
## 分区物化视图只保留最近分区数据
:::tip 提示
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index 5320b6c62d8..37996c9113c 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -454,7 +454,7 @@ SELECT * FROM t1;
### SQL 定义
-异步物化视图 SQL 定义没有限制。
+异步物化视图不支持使用 View 创建
## 直查物化视图
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index 822509c36b2..050fd316ed8 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -448,7 +448,7 @@ SELECT * FROM t1;
### SQL 定义
-异步物化视图 SQL 定义没有限制。
+异步物化视图不支持使用 View 创建
## 直查物化视图
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index ae87ea53ee6..a31324798f4 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -446,9 +446,36 @@ SELECT * FROM t1;
详情参考 [CREATE ASYNC MATERIALIZED VIEW](../../../sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW)
+#### 分区多端刷新
+“多端刷新” 允许异步物化视图有多个分区追踪表,即允许多个表的数据发生变化,物化视图都只进行分区刷新,而不是全量刷新。
+
+该特性在使用中存在以下限制:
+- 仅支持基于 INNER JOIN 或 UNION (包括 UNION ALL) 所构建的物化视图。
+- 当物化视图使用 UNION 操作时,所有参与联合的部分都必须支持分区变化追踪(PCT)。 例如物化视图的 sql 定义为:q1 union all q2, 那么要求单独使用 q1 或 q2 创建物化视图都能进行分区刷新,且推导出的分区字段的顺序一致。
+- 多 PCT 表间的分区粒度要对齐
+ - 允许的示例:
+
+ 基表 t1 的分区:[2020-01-01, 2020-01-02), [2020-01-02, 2020-01-03)
+
+ 基表 t2 的分区:[2020-01-02, 2020-01-03), [2020-01-03, 2020-01-04)
+
+ 多个基表的分区不完全一致,但是没有交叉
+
+ - 不允许的示例:
+
+ 基表 t1 的分区:[2020-01-01, 2020-01-03), [2020-01-03, 2020-01-05)
+
+ 基表 t2 的分区:[2020-01-01, 2020-01-02), [2020-01-03, 2020-01-05)
+
+ [2020-01-01, 2020-01-03) 和 [2020-01-01, 2020-01-02) 有交叉又不完全一样
+
### SQL 定义
-异步物化视图 SQL 定义没有限制。
+异步物化视图支持基于内部视图(View)进行创建,但不支持基于外部数据源中的视图构建。
+
+需要注意的是,当所依赖的内部视图发生修改或重建时,会导致异步物化视图与基表之间的数据不一致。此时,虽然物化视图中的数据仍然存在,但无法支持查询的透明改写。
+
+此外,如果结构变更影响了异步物化视图所依赖的分区追踪表或字段,或使其 Schema 发生变化,该物化视图将无法刷新成功。若变更未影响上述元素,则刷新物化视图后,即可恢复正常使用。
## 直查物化视图
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md
index f1abdaebf6f..206d952e775 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md
@@ -162,101 +162,6 @@ GROUP BY
date_trunc(l_ordertime, 'day');
```
-## 创建包含 UNION ALL 的分区物化视图
-目前 Doris 有限制,分区物化定义中不能包含 UNION ALL 子句。
-如果想要创建包含 UNION ALL 的物化视图,可以使用采用如下的方式创建。对于 UNION ALL 的每部分输入
-尝试创建分区物化视图,之后针对整个 UNION ALL 结果集创建一个普通视图。
-
-例如:
-物化视图定义如下,要使用如下 sql 语句构建分区物化视图,可以看到 sql 语句包含 UNION ALL 子句。
-```sql
-SELECT
- l_linestatus,
- sum(
- l_extendedprice * (1 - l_discount)
- ) AS revenue,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey
-GROUP BY
- l_linestatus,
- ps_partkey,
- date_trunc(l_ordertime, 'day')
-UNION ALL
-SELECT
- l_linestatus,
- l_extendedprice,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey;
-```
-
-可以将上述 SQL 语句拆分成两个部分,分别创建两个分区物化视图。
-
-```sql
-CREATE MATERIALIZED VIEW union_sub_mv1
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-AS
-SELECT
- l_linestatus,
- sum(
- l_extendedprice * (1 - l_discount)
- ) AS revenue,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey
-GROUP BY
- l_linestatus,
- ps_partkey,
- date_trunc(l_ordertime, 'day');
-```
-
-
-```sql
-CREATE MATERIALIZED VIEW union_sub_mv2
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-
-AS
-SELECT
- l_linestatus,
- l_extendedprice,
- ps_partkey,
- date_trunc(l_ordertime, 'day') as order_date
-FROM
- lineitem
- LEFT JOIN partsupp ON l_partkey = ps_partkey
- and l_suppkey = ps_suppkey;
-```
-
-然后创建一个普通视图,将两个分区物化视图的结果集进行 UNION ALL。对外可以提供这个视图 union_all_view
-
-```sql
-CREATE VIEW union_all_view
-AS
-SELECT *
-FROM
-union_sub_mv1
-UNION ALL
-SELECT *
-FROM
-union_sub_mv2;
-
-```
-
-
## 分区物化视图只保留最近分区数据
:::tip 提示
diff --git a/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index a037b30a359..d026a0cba25 100644
--- a/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -469,7 +469,7 @@ Additionally, if the partition field is of string type, the date format can be s
For more details, refer to [CREATE ASYNC MATERIALIZED VIEW](../../../sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW).
### SQL Definition
-There are no restrictions on the SQL definition of asynchronous materialized views.
+Asynchronous materialized views do not support creation using View.
## Direct Querying of Materialized Views
diff --git a/versioned_docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/versioned_docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index 09b334319b3..db4284aba3e 100644
--- a/versioned_docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/versioned_docs/version-3.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -463,7 +463,7 @@ Additionally, if the partition field is of string type, the date format can be s
For more details, refer to [CREATE ASYNC MATERIALIZED VIEW](../../../sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW).
### SQL Definition
-There are no restrictions on the SQL definition of asynchronous materialized views.
+Asynchronous materialized views do not support creation using View.
## Direct Querying of Materialized Views
diff --git a/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md b/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
index 1f1f41b2098..982229f3111 100644
--- a/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
+++ b/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/functions-and-demands.md
@@ -462,8 +462,36 @@ Additionally, if the partition field is of string type, the date format can be s
For more details, refer to [CREATE ASYNC MATERIALIZED VIEW](../../../sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW).
+#### Multi-PCT Refresh
+"Multi-PCT Refresh" allows asynchronous materialized views to have multiple partition change tracking (PCT) tables, meaning that when data changes occur in multiple base tables, only partition-level refresh is performed instead of a full refresh.
+
+This feature has the following limitations in usage:
+- Only materialized views built based on INNER JOIN or UNION (including UNION ALL) are supported.
+- When the materialized view uses UNION operations, all participating union components must support Partition Change Tracking (PCT). For example, if the materialized view's SQL definition is: q1 UNION ALL q2, then both q1 and q2 must individually support partition refresh when used alone to create materialized views, and the derived partition columns must have consistent ordering.
+- The partition granularity across multiple PCT tables must be aligned:
+ - **Allowed example**:
+
+ Partitions of base table t1: [2020-01-01, 2020-01-02), [2020-01-02, 2020-01-03)
+
+ Partitions of base table t2: [2020-01-02, 2020-01-03), [2020-01-03, 2020-01-04)
+
+ The partitions of multiple base tables are not completely identical, but they do not overlap.
+
+ - **Disallowed example**:
+
+ Partitions of base table t1: [2020-01-01, 2020-01-03), [2020-01-03, 2020-01-05)
+
+ Partitions of base table t2: [2020-01-01, 2020-01-02), [2020-01-03, 2020-01-05)
+
+ Partitions [2020-01-01, 2020-01-03) and [2020-01-01, 2020-01-02) overlap but are not identical.
+
### SQL Definition
-There are no restrictions on the SQL definition of asynchronous materialized views.
+
+Asynchronous materialized views can be created based on internal views but do not support construction based on views from external data sources.
+
+It is important to note that when the underlying internal views are modified or rebuilt, it may lead to data inconsistencies between the asynchronous materialized view and the base tables. In such cases, although the data in the materialized view still exists, it cannot support transparent query rewriting.
+
+Additionally, if structural changes affect the partition tracking tables or columns relied upon by the asynchronous materialized view, or cause changes to its schema, the materialized view will fail to refresh successfully. If the changes do not impact these elements, the materialized view can resume normal operation after a refresh.
## Direct Querying of Materialized Views
diff --git a/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md b/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md
index af3c0931fdd..ffbebb4280a 100644
--- a/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md
+++ b/versioned_docs/version-4.x/query-acceleration/materialized-view/async-materialized-view/use-guide.md
@@ -164,100 +164,6 @@ GROUP BY
date_trunc(l_ordertime, 'day');
```
-## Creating Partitioned Materialized Views with UNION ALL
-Currently, Doris has a limitation where partitioned materialized view definitions cannot contain UNION ALL clauses.
-To create a materialized view that includes UNION ALL, you can use the following approach: For each input part of the UNION ALL,
-attempt to create a partitioned materialized view, and then create a regular view for the entire UNION ALL result set.
-
-For example:
-The materialized view definition below contains a UNION ALL clause, which cannot be directly used to create a partitioned materialized view.
-
-```sql
-
-SELECT
-l_linestatus,
-sum(
-l_extendedprice * (1 - l_discount)
-) AS revenue,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey
-GROUP BY
-l_linestatus,
-ps_partkey,
-date_trunc(l_ordertime, 'day')
-UNION ALL
-SELECT
-l_linestatus,
-l_extendedprice,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey;
-```
-
-You can split the above SQL statement into two parts and create two partitioned materialized views separately.
-
-```sql
-
-CREATE MATERIALIZED VIEW union_sub_mv1
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-AS
-SELECT
-l_linestatus,
-sum(
-l_extendedprice * (1 - l_discount)
-) AS revenue,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey
-GROUP BY
-l_linestatus,
-ps_partkey,
-date_trunc(l_ordertime, 'day');
-```
-
-```sql
-CREATE MATERIALIZED VIEW union_sub_mv2
-BUILD IMMEDIATE REFRESH AUTO ON MANUAL
-partition by(order_date)
-DISTRIBUTED BY RANDOM BUCKETS 2
-AS
-SELECT
-l_linestatus,
-l_extendedprice,
-ps_partkey,
-date_trunc(l_ordertime, 'day') as order_date
-FROM
-lineitem
-LEFT JOIN partsupp ON l_partkey = ps_partkey
-and l_suppkey = ps_suppkey;
-```
-Then create a regular view that performs UNION ALL on the result sets of the two partitioned materialized views.
-This view (union_all_view) can be exposed externally.
-
-```sql
-CREATE VIEW union_all_view
-AS
-SELECT *
-FROM
-union_sub_mv1
-UNION ALL
-SELECT *
-FROM
-union_sub_mv2;
-```
-
## Partitioned Materialized Views Retaining Only Recent Partition Data
:::tip Note
This feature has been supported since Apache Doris version 2.1.1.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org