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 25bcd2922db [docs](ddl)add where condition for create materialized 
view command (#3079)
25bcd2922db is described below

commit 25bcd2922dbc7009d1e359be2f2e4df9bab0abf4
Author: starocean999 <[email protected]>
AuthorDate: Wed Nov 26 16:38:16 2025 +0800

    [docs](ddl)add where condition for create materialized view command (#3079)
    
    ## Versions
    
    - [x] dev
    - [x] 4.x
    - [x] 3.x
    - [x] 2.1
    
    ## Languages
    
    - [x] Chinese
    - [x] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 .../table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md | 4 ++++
 8 files changed, 32 insertions(+)

diff --git 
a/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index 81f1afa864d..5be55153296 100644
--- 
a/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - Must include at least one single column.
 > - `base_table`: The name of the base table for the materialized view, a 
 > required item.
 >   - Must be a single table, not a subquery.
+> - `where`: The filter condition of the materialized view, an optional item.
+>   - If not specified, no data filtering will be performed.
 > - `group by`: The grouping columns of the materialized view, an optional 
 > item.
 >   - If not specified, the data will not be grouped.
 > - `order by`: The sorting columns of the materialized view, an optional item.
@@ -69,6 +72,7 @@ query
 - If the SELECT list contains aggregate functions, the aggregate functions 
must be root expressions (e.g., `sum(a + 1)` is supported, but `sum(a) + 1` is 
not), and no other non-aggregate function expressions can follow the aggregate 
functions (for example, `SELECT x, sum(a)` is acceptable, but `SELECT sum(a), 
x` is not).
 - Too many materialized views on a single table can affect the efficiency of 
data import: when importing data, the data of the materialized views and the 
Base table are updated synchronously. If there are too many materialized views 
on a table, it may slow down the import speed, similar to importing data into 
multiple tables simultaneously in a single import operation.
 - When a materialized view targets the Unique Key data model, it can only 
change the order of columns and cannot perform aggregation. Therefore, on the 
Unique Key model, data cannot be coarsely aggregated by creating materialized 
views.
+- When a materialized view targets Unique Key and Aggregate Key data models, 
if a WHERE clause is specified, it can only use Key columns and not Value 
columns.
 
 ## Example
 
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index 90f0f792234..a6987efc33f 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - 至少包含一个单列。
 > - `base_table`:物化视图的原始表名,必填项。
 >   - 必须是单表,且非子查询
+> - `where`:物化视图的过滤条件,选填项。
+>   - 不填则数据不进行过滤。
 > - `group by`:物化视图的分组列,选填项。
 >   - 不填则数据不进行分组。
 > - `order by`:物化视图的排序列,选填项。
@@ -69,6 +72,7 @@ query
 - 如果 SELECT 列表包含聚合函数,则聚合函数必须是根表达式(不支持 `sum(a) + 1`,支持 `sum(a + 
1)`),且聚合函数之后不能有其他非聚合函数表达式(例如,`SELECT x, sum(a)` 可以,而 `SELECT sum(a)`, x 不行)。
 - 单表上过多的物化视图会影响导入的效率:导入数据时,物化视图和 Base 
表的数据是同步更新的。如果一张表的物化视图表过多,可能会导致导入速度变慢,这就像单次导入需要同时导入多张表的数据一样。
 - 物化视图针对 Unique Key 数据模型时,只能改变列的顺序,不能起到聚合的作用。因此,在 Unique Key 
模型上不能通过创建物化视图的方式对数据进行粗粒度的聚合操作。
+- 物化视图针对 Unique Key和Aggregate Key 
数据模型时,如果指定了where条件,那where条件只能使用Key列,而不能使用Value列。
 
 ## 示例
 
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index ff636354c6f..0339fb0ce6e 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - 至少包含一个单列。
 > - `base_table`:物化视图的原始表名,必填项。
 >   - 必须是单表,且非子查询
+> - `where`:物化视图的过滤条件,选填项。
+>   - 不填则数据不进行过滤。
 > - `group by`:物化视图的分组列,选填项。
 >   - 不填则数据不进行分组。
 > - `order by`:物化视图的排序列,选填项。
@@ -68,6 +71,7 @@ query
 - 如果 SELECT 列表包含聚合函数,则聚合函数必须是根表达式(不支持 `sum(a) + 1`,支持 `sum(a + 
1)`),且聚合函数之后不能有其他非聚合函数表达式(例如,`SELECT x, sum(a)` 可以,而 `SELECT sum(a)`, x 不行)。
 - 单表上过多的物化视图会影响导入的效率:导入数据时,物化视图和 Base 
表的数据是同步更新的。如果一张表的物化视图表过多,可能会导致导入速度变慢,这就像单次导入需要同时导入多张表的数据一样。
 - 物化视图针对 Unique Key 数据模型时,只能改变列的顺序,不能起到聚合的作用。因此,在 Unique Key 
模型上不能通过创建物化视图的方式对数据进行粗粒度的聚合操作。
+- 物化视图针对 Unique Key和Aggregate Key 
数据模型时,如果指定了where条件,那where条件只能使用Key列,而不能使用Value列。
 
 ## 示例
 
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index ff636354c6f..0339fb0ce6e 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - 至少包含一个单列。
 > - `base_table`:物化视图的原始表名,必填项。
 >   - 必须是单表,且非子查询
+> - `where`:物化视图的过滤条件,选填项。
+>   - 不填则数据不进行过滤。
 > - `group by`:物化视图的分组列,选填项。
 >   - 不填则数据不进行分组。
 > - `order by`:物化视图的排序列,选填项。
@@ -68,6 +71,7 @@ query
 - 如果 SELECT 列表包含聚合函数,则聚合函数必须是根表达式(不支持 `sum(a) + 1`,支持 `sum(a + 
1)`),且聚合函数之后不能有其他非聚合函数表达式(例如,`SELECT x, sum(a)` 可以,而 `SELECT sum(a)`, x 不行)。
 - 单表上过多的物化视图会影响导入的效率:导入数据时,物化视图和 Base 
表的数据是同步更新的。如果一张表的物化视图表过多,可能会导致导入速度变慢,这就像单次导入需要同时导入多张表的数据一样。
 - 物化视图针对 Unique Key 数据模型时,只能改变列的顺序,不能起到聚合的作用。因此,在 Unique Key 
模型上不能通过创建物化视图的方式对数据进行粗粒度的聚合操作。
+- 物化视图针对 Unique Key和Aggregate Key 
数据模型时,如果指定了where条件,那where条件只能使用Key列,而不能使用Value列。
 
 ## 示例
 
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index 90f0f792234..a6987efc33f 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - 至少包含一个单列。
 > - `base_table`:物化视图的原始表名,必填项。
 >   - 必须是单表,且非子查询
+> - `where`:物化视图的过滤条件,选填项。
+>   - 不填则数据不进行过滤。
 > - `group by`:物化视图的分组列,选填项。
 >   - 不填则数据不进行分组。
 > - `order by`:物化视图的排序列,选填项。
@@ -69,6 +72,7 @@ query
 - 如果 SELECT 列表包含聚合函数,则聚合函数必须是根表达式(不支持 `sum(a) + 1`,支持 `sum(a + 
1)`),且聚合函数之后不能有其他非聚合函数表达式(例如,`SELECT x, sum(a)` 可以,而 `SELECT sum(a)`, x 不行)。
 - 单表上过多的物化视图会影响导入的效率:导入数据时,物化视图和 Base 
表的数据是同步更新的。如果一张表的物化视图表过多,可能会导致导入速度变慢,这就像单次导入需要同时导入多张表的数据一样。
 - 物化视图针对 Unique Key 数据模型时,只能改变列的顺序,不能起到聚合的作用。因此,在 Unique Key 
模型上不能通过创建物化视图的方式对数据进行粗粒度的聚合操作。
+- 物化视图针对 Unique Key和Aggregate Key 
数据模型时,如果指定了where条件,那where条件只能使用Key列,而不能使用Value列。
 
 ## 示例
 
diff --git 
a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index eaed4333983..7be910e320e 100644
--- 
a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - Must include at least one single column.
 > - `base_table`: The name of the base table for the materialized view, a 
 > required item.
 >   - Must be a single table, not a subquery.
+> - `where`: The filter condition of the materialized view, an optional item.
+>   - If not specified, no data filtering will be performed.
 > - `group by`: The grouping columns of the materialized view, an optional 
 > item.
 >   - If not specified, the data will not be grouped.
 > - `order by`: The sorting columns of the materialized view, an optional item.
@@ -68,6 +71,7 @@ query
 - If the SELECT list contains aggregate functions, the aggregate functions 
must be root expressions (e.g., `sum(a + 1)` is supported, but `sum(a) + 1` is 
not), and no other non-aggregate function expressions can follow the aggregate 
functions (for example, `SELECT x, sum(a)` is acceptable, but `SELECT sum(a), 
x` is not).
 - Too many materialized views on a single table can affect the efficiency of 
data import: when importing data, the data of the materialized views and the 
Base table are updated synchronously. If there are too many materialized views 
on a table, it may slow down the import speed, similar to importing data into 
multiple tables simultaneously in a single import operation.
 - When a materialized view targets the Unique Key data model, it can only 
change the order of columns and cannot perform aggregation. Therefore, on the 
Unique Key model, data cannot be coarsely aggregated by creating materialized 
views.
+- When a materialized view targets Unique Key and Aggregate Key data models, 
if a WHERE clause is specified, it can only use Key columns and not Value 
columns.
 
 ## Example
 
diff --git 
a/versioned_docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/versioned_docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index eaed4333983..7be910e320e 100644
--- 
a/versioned_docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/versioned_docs/version-3.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - Must include at least one single column.
 > - `base_table`: The name of the base table for the materialized view, a 
 > required item.
 >   - Must be a single table, not a subquery.
+> - `where`: The filter condition of the materialized view, an optional item.
+>   - If not specified, no data filtering will be performed.
 > - `group by`: The grouping columns of the materialized view, an optional 
 > item.
 >   - If not specified, the data will not be grouped.
 > - `order by`: The sorting columns of the materialized view, an optional item.
@@ -68,6 +71,7 @@ query
 - If the SELECT list contains aggregate functions, the aggregate functions 
must be root expressions (e.g., `sum(a + 1)` is supported, but `sum(a) + 1` is 
not), and no other non-aggregate function expressions can follow the aggregate 
functions (for example, `SELECT x, sum(a)` is acceptable, but `SELECT sum(a), 
x` is not).
 - Too many materialized views on a single table can affect the efficiency of 
data import: when importing data, the data of the materialized views and the 
Base table are updated synchronously. If there are too many materialized views 
on a table, it may slow down the import speed, similar to importing data into 
multiple tables simultaneously in a single import operation.
 - When a materialized view targets the Unique Key data model, it can only 
change the order of columns and cannot perform aggregation. Therefore, on the 
Unique Key model, data cannot be coarsely aggregated by creating materialized 
views.
+- When a materialized view targets Unique Key and Aggregate Key data models, 
if a WHERE clause is specified, it can only use Key columns and not Value 
columns.
 
 ## Example
 
diff --git 
a/versioned_docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
 
b/versioned_docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
index 81f1afa864d..5be55153296 100644
--- 
a/versioned_docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
+++ 
b/versioned_docs/version-4.x/sql-manual/sql-statements/table-and-view/sync-materialized-view/CREATE-MATERIALIZED-VIEW.md
@@ -22,6 +22,7 @@ query
     :
     SELECT <select_expr> select_expr[, select_expr ...]
     FROM <base_table>
+    WHERE condition
     GROUP BY <column_name>[, <column_name> ...]
     ORDER BY <column_name>[, <column_name> ...]
 ```
@@ -48,6 +49,8 @@ query
 >   - Must include at least one single column.
 > - `base_table`: The name of the base table for the materialized view, a 
 > required item.
 >   - Must be a single table, not a subquery.
+> - `where`: The filter condition of the materialized view, an optional item.
+>   - If not specified, no data filtering will be performed.
 > - `group by`: The grouping columns of the materialized view, an optional 
 > item.
 >   - If not specified, the data will not be grouped.
 > - `order by`: The sorting columns of the materialized view, an optional item.
@@ -69,6 +72,7 @@ query
 - If the SELECT list contains aggregate functions, the aggregate functions 
must be root expressions (e.g., `sum(a + 1)` is supported, but `sum(a) + 1` is 
not), and no other non-aggregate function expressions can follow the aggregate 
functions (for example, `SELECT x, sum(a)` is acceptable, but `SELECT sum(a), 
x` is not).
 - Too many materialized views on a single table can affect the efficiency of 
data import: when importing data, the data of the materialized views and the 
Base table are updated synchronously. If there are too many materialized views 
on a table, it may slow down the import speed, similar to importing data into 
multiple tables simultaneously in a single import operation.
 - When a materialized view targets the Unique Key data model, it can only 
change the order of columns and cannot perform aggregation. Therefore, on the 
Unique Key model, data cannot be coarsely aggregated by creating materialized 
views.
+- When a materialized view targets Unique Key and Aggregate Key data models, 
if a WHERE clause is specified, it can only use Key columns and not Value 
columns.
 
 ## Example
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to