Skip to content

Commit

Permalink
[Doc] Add 3.3 MV-related params (backport #44870) (#44929)
Browse files Browse the repository at this point in the history
Signed-off-by: 絵空事スピリット <[email protected]>
Co-authored-by: 絵空事スピリット <[email protected]>
  • Loading branch information
mergify[bot] and EsoragotoSpirit authored Apr 29, 2024
1 parent ddd7b4f commit 10f4306
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 40 deletions.
9 changes: 9 additions & 0 deletions docs/en/administration/management/FE_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,15 @@ ADMIN SET FRONTEND CONFIG ("key" = "value");
- Description: Whether to enable the asynchronous materialized view feature. TRUE indicates this feature is enabled. From v2.5.2 onwards, this feature is enabled by default. For versions earlier than v2.5.2, this feature is disabled by default.
- Introduced in: v2.4

##### enable_materialized_view_metrics_collect

- Default: true
- Type: Boolean
- Unit: -
- Is mutable: Yes
- Description: Whether to collect monitoring metrics for asynchronous materialized views by default.
- Introduced in: v3.1.11, v3.2.5

##### enable_mv_automatic_active_check

- Default: true
Expand Down
36 changes: 18 additions & 18 deletions docs/en/reference/System_variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,56 +184,56 @@ Used for MySQL client compatibility. No practical usage.

### enable_sync_materialized_view_rewrite

* **Description**: Whether to enable synchronized materialized view rewrite or not.
* **Description**: Whether to enable query rewrite based on synchronous materialized views.
* **Default**: true
* **Introduced in**: v3.1
* **Introduced in**: v3.1.11, v3.2.5

### query_including_mv_names

* **Description**: Specifies the including mv names to be used for materialized view rewrite to reduce the related materialized view numbers and reduce the optimizer time for rewrite.
* **Description**: Specifies the name of the asynchronous materialized views to include in query execution. You can use this variable to limit the number of candidate materialized views and improve the query rewrite performance in the optimizer. This item takes effect prior to `query_excluding_mv_names`.
* **Default**: empty
* **Data type**: String
* **Introduced in**: v3.1
* **Introduced in**: v3.1.11, v3.2.5

### query_excluding_mv_names(

* **Description**: Specifies the excluding mv names to be used for materialized view rewrite to reduce the related materialized view numbers and reduce the optimizer time for rewrite.
* **Description**: Specifies the name of the asynchronous materialized views to exclude from query execution. You can use this variable to limit the number of candidate materialized views and reduce the time of query rewrite in the optimizer. `query_including_mv_names` takes effect prior to this item.
* **Default**: empty
* **Data type**: String
* **Introduced in**: v3.1
* **Introduced in**: v3.1.11, v3.2.5

### optimizer_materialized_view_timelimit

* **Description**: Specifies the maximum time that one materialized view rewrite rule costs before exhausted
* **Default**: 1000(ms)
* **Description**: Specifies the maximum time that one materialized view rewrite rule can consume. When the threshold is reached, this rule will not be used for query rewrite.
* **Default**: 1000
* **Unit**: ms
* **Introduced in**: v3.1.9, v3.2.5

### enable_view_based_mv_rewrite

* **Description**: Whether to enable view based rewrite or not. If true, treat logical view as unified node to rewrite rather than inlining it to be better for rewrite.
* **Description**: Whether to enable query rewrite for logical view-based materialized views. If this item is set to `true`, the logical view is used as a unified node to rewrite the queries against itself for better performance. If this item is set to `false`, the system transcribes the queries against logical views into queries against physical tables or materialized views and then rewrites them.
* **Default**: false
* **Introduced in**: v3.1.9, v3.2.5
* **Introduced in**: v3.1.9, v3.2.5, v3.3.0

### enable_materialized_view_union_rewrite

* **Description**: Whether to enable materialized view union rewrite or not. If true, try to use union all compensate when materialized view predicates cannot satisfy the query's predicates.
* **Description**: Whether to enable materialized view union rewrite. If this item is set to `true`, the system seeks to compensate the predicates using UNION ALL when the predicates in the materialized view cannot satisfy the query's predicates.
* **Default**: true
* **Introduced in**: v2.5
* **Introduced in**: v2.5.20, v3.1.9, v3.2.7, v3.3.0

### follower_query_forward_mode

* **Description**: Flag to control whether to proxy follower's query statement to leader/follower.
* **Description**: Specifies to which FE nodes the query statements are routed.

Valid values:
* Valid values:

* `default`: proxy the query statement to leader/follower decided by the follower's replay progress.
* `leader`: proxy the query statement to leader fe.
* `follower`: not proxy the query statement to leader fe.
* `default`: Routes the query statement to the Leader FE or Follower FEs, depending on the Follower's replay progress. If the Follower FE nodes have not completed replay progress, queries will be routed to the Leader FE node. If the replay progress is complete, queries will be preferentially routed to the Follower FE node.
* `leader`: Routes the query statement to the Leader FE.
* `follower`: Routes the query statement to Follower FE.

* **Default**: default
* **Data type**: String
* **Introduced in**: v2.5
* **Introduced in**: v2.5.20, v3.1.9, v3.2.7, v3.3.0

### character_set_database (global)

Expand Down
9 changes: 9 additions & 0 deletions docs/zh/administration/management/FE_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,15 @@ ADMIN SET FRONTEND CONFIG ("key" = "value");
- 描述:是否开启异步物化视图功能。`TRUE` 表示开启。从 2.5.2 版本开始,该功能默认开启。2.5.2 版本之前默认值为 `FALSE`
- 引入版本:v2.4

##### enable_materialized_view_metrics_collect

- 默认值:true
- 类型:Boolean
- 单位:-
- 是否动态:是
- 描述:是否默认收集异步物化视图的监控指标。
- 引入版本:v3.1.11,v3.2.5

##### enable_mv_automatic_active_check

- 默认值:true
Expand Down
39 changes: 20 additions & 19 deletions docs/zh/reference/System_variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,53 +183,54 @@ SELECT /*+ SET_VAR

### enable_sync_materialized_view_rewrite

* 描述:是否启用同步物化视图自动改写
* 描述:是否启用基于同步物化视图的查询改写
* 默认值:true
* 引入版本:v3.1
* 引入版本:v3.1.11,v3.2.5

### query_including_mv_names

* 描述:指定用于物化视图自动改写包含的物化视图名称,以减少相关物化视图数量,并减少优化器用于重写的时间
* 默认值:empty string
* 描述:指定需要在查询执行过程中包含的异步物化视图的名称。您可以使用此变量来限制候选物化视图的数量,并提高优化器中的查询改写性能。此项优先于 `query_excluding_mv_names` 生效
* 默认值:空字符串
* 类型:String
* 引入版本:v3.1
* 引入版本:v3.1.11,v3.2.5

### query_excluding_mv_names

* 描述:指定用于物化视图自动改写排除的物化视图名称,以减少相关物化视图数量,并减少优化器用于重写的时间
* 默认值:empty string
* 描述:指定需要在查询执行过程中排除的异步物化视图的名称。您可以使用此变量来限制候选物化视图的数量,并提高优化器中的查询改写性能。`query_including_mv_names` 优先于此项生效
* 默认值:空字符串
* 类型:String
* 引入版本:v3.1
* 引入版本:v3.1.11,v3.2.5

### optimizer_materialized_view_timelimit

* 描述:在一个 Query改写中,指定一个物化视图自动改写规则最大耗时时间,超过该时间后,不会再使用改规则进行自动改写
* 默认值:1000 (ms)
* 描述:指定一个物化视图改写规则可消耗的最大时间。当达到阈值时,将不再使用该规则进行查询改写
* 默认值:1000
* 单位:毫秒
* 类型:Long

### enable_view_based_mv_rewrite

* 描述:是否启用基于视图的重写。如果设置为true,则将逻辑视图视为统一节点进行重写,而不是内联它,以便更好地进行重写
* 描述:是否为基于逻辑视图创建的物化视图启用查询改写。如果此项设置为 `true`,则逻辑视图被用作统一节点进行查询改写,从而获得更好的性能。如果此项设置为 `false`,则系统将针对逻辑视图的查询展开变为针对物理表或物化视图的查询,然后进行改写
* 默认值:false
* 引入版本:v3.1.9, v3.2.5
* 引入版本:v3.1.9v3.2.5,v3.3.0

### enable_materialized_view_union_rewrite

* 描述:是否启用物化视图 Union Rewrite: 如果设置为true,则在物化视图的谓词不能满足查询的谓词时,尝试使用 UNION ALL 进行补偿
* 描述:是否启用物化视图 UNION 改写。如果此项设置为 true,则系统在物化视图的谓词不能满足查询的谓词时,会尝试使用 UNION ALL 来补偿谓词
* 默认值:true
* 引入版本:v2.5
* 引入版本:v2.5.20,v3.1.9,v3.2.7,v3.3.0

### follower_query_forward_mode

* 描述:用于控制将查询路由到 FE Leader/Follower的标志。
* 描述:用于指定将查询语句路由到 Leader FE 或 Follower FE 节点。

有效值:
* `default`: 将查询语句路由到 Leader/Follower,由 Follower 的回放进度决定
* `leader`: 将查询语句路由到 Leader。
* `follower`: 将查询语句路由到 Follower。
* `default`: 将查询语句路由到 Leader FE 或 Follower FE 节点,取决于 Follower FE 节点的回放进度。如果 Follower FE 节点未完成回放,查询将会被路由至 Leader FE 节点。反之,查询会被优先路由至 Follower FE 节点
* `leader`: 将查询语句路由到 Leader FE 节点
* `follower`: 将查询语句路由到 Follower FE 节点
* 默认值:default
* 类型:String
* 引入版本:v2.5
* 引入版本:v2.5.20,v3.1.9,v3.2.7,v3.3.0

### character_set_database(global)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ AS
- `resource_group`: 为物化视图刷新任务设置资源组。更多关于资源组信息,请参考[资源隔离](../../../administration/management/resource_management/resource_group.md)
- `storage_volume`:如果您使用存算分离集群,则需要指定创建物化视图的 [Storage Volume](../../../deployment/shared_data/s3.md#使用-starrocks-存算分离集群) 名称。该属性自 v3.1 版本起支持。如果未指定该属性,则使用默认 Storage Volume。示例:`"storage_volume" = "def_volume"`

> **注意**
>
> Unique Key 约束和外键约束仅用于查询重写。导入数据时,不保证进行外键约束校验。您必须确保导入的数据满足约束条件。
> **注意**
>
> Unique Key 约束和外键约束仅用于查询改写。导入数据时,不保证进行外键约束校验。您必须确保导入的数据满足约束条件。
**query_statement**(必填)

Expand Down

0 comments on commit 10f4306

Please sign in to comment.