From b551145df5eb1e0a4cf49d4af56cb162bdd7b876 Mon Sep 17 00:00:00 2001 From: JaySon Date: Tue, 26 May 2020 16:48:03 +0800 Subject: [PATCH 1/2] cherry pick #3265 to release-4.0 Signed-off-by: sre-bot --- tidb-specific-system-variables.md | 11 +++++++++++ tiflash/tune-tiflash-performance.md | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tidb-specific-system-variables.md b/tidb-specific-system-variables.md index 01371b79d5cc..1852015989fe 100644 --- a/tidb-specific-system-variables.md +++ b/tidb-specific-system-variables.md @@ -768,6 +768,7 @@ TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在 这个变量用来显示上一个 `execute` 语句所使用的执行计划是不是直接从 plan cache 中取出来的。 +<<<<<<< HEAD ### ddl_slow_threshold 作用域:SESSION @@ -866,10 +867,13 @@ TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在 这个变量用来设置一天中允许自动演进的结束时间。 +======= +>>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) ### tidb_allow_batch_cop 从 v4.0 版本开始引入 作用域:SESSION | GLOBAL +<<<<<<< HEAD 默认值: 0 这个变量用于控制 TiDB 向 TiFlash 发送 coprocessor 请求的方式,有以下几种取值: @@ -949,3 +953,10 @@ TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在 默认值: 60 这个变量设置了查询 METRIC_SCHEMA 时生成的 Prometheus 语句的 range duration,单位为秒。 +======= +默认值:0 + +这个变量用来设置从 TiFlash 读取数据时,是否把 Region 的请求进行合并。 + +当查询的表拥有 TiFlash 副本,且查询涉及的 Region 数量比较多,可以尝试设置该变量为 `1`(对带 `aggregation` 下推到 TiFlash Coprocessor 的请求生效),或设置该变量为 `2`(对全部下推到 TiFlash Coprocessor 请求生效)。 +>>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) diff --git a/tiflash/tune-tiflash-performance.md b/tiflash/tune-tiflash-performance.md index b032a8a7e0e8..0d624e9f4704 100644 --- a/tiflash/tune-tiflash-performance.md +++ b/tiflash/tune-tiflash-performance.md @@ -22,9 +22,14 @@ aliases: ['/docs-cn/stable/reference/tiflash/tune-performance/'] set @@tidb_distsql_scan_concurrency = 80; ``` +<<<<<<< HEAD 2. 开启 Super batch 功能: [`tidb_allow_batch_cop`](/tidb-specific-system-variables.md#tidb_allow_batch_cop) 变量用来设置从 TiFlash 读取时,是否把 Region 的请求进行合并。当查询中涉及的 Region 数量比较大,可以尝试设置该变量为 `1`(对带 `aggregation` 下推到 TiFlash Coprocessor 的请求生效),或设置该变量为 `2`(对全部下推到 TiFlash Coprocessor 请求生效)。 +======= +2. 开启 Super batch 功能: +[`tidb_allow_batch_cop`](/tidb-specific-system-variables.md#tidb_allow_batch_cop) 变量用来设置从 TiFlash 读取时,是否把 Region 的请求进行合并。当查询中涉及的 Region 数量比较大,可以尝试设置该变量为 `1`(对带 `aggregation` 下推到 TiFlash Coprocessor 的请求生效),或设置该变量为 `2`(对全部下推到 TiFlash Coprocessor 请求生效)。 +>>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) {{< copyable "sql" >}} @@ -32,9 +37,14 @@ aliases: ['/docs-cn/stable/reference/tiflash/tune-performance/'] set @@tidb_allow_batch_cop = 1; ``` +<<<<<<< HEAD 3. 尝试开启聚合推过 `Join` / `Union` 等 TiDB 算子的优化: [`tidb_opt_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_agg_push_down) 变量用来设置优化器是否执行聚合函数下推到 Join 之前的优化操作。当查询中聚合操作执行很慢时,可以尝试设置该变量为 1。 +======= +3. 尝试开启聚合推过 `Join` / `Union` 等 TiDB 算子的优化: +[`tidb_opt_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_agg_push_down) 变量用来设置优化器是否执行聚合函数下推到 Join 之前的优化操作。当查询中聚合操作执行很慢时,可以尝试设置该变量为 1。 +>>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) {{< copyable "sql" >}} @@ -42,9 +52,14 @@ aliases: ['/docs-cn/stable/reference/tiflash/tune-performance/'] set @@tidb_opt_agg_push_down = 1; ``` +<<<<<<< HEAD 4. 尝试开启 `Distince` 推过 `Join` / `Union` 等 TiDB 算子的优化: [`tidb_opt_distinct_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_distinct_agg_push_down) 变量用来设置优化器是否执行带有 `Distinct` 的聚合函数(比如 `select count(distinct a) from t`)下推到 Coprocessor 的优化操作。当查询中带有 `Distinct` 的聚合操作执行很慢时,可以尝试设置该变量为 `1`。 +======= +4. 尝试开启 `Distince` 推过 `Join` / `Union` 等 TiDB 算子的优化: +[`tidb_opt_distinct_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_distinct_agg_push_down) 变量用来设置优化器是否执行带有 `Distinct` 的聚合函数(比如 `select count(distinct a) from t`)下推到 Coprocessor 的优化操作。当查询中带有 `Distinct` 的聚合操作执行很慢时,可以尝试设置该变量为 `1`。 +>>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) {{< copyable "sql" >}} From c8e4b51877b4b9c7dc90e5cff4873fa88dea3766 Mon Sep 17 00:00:00 2001 From: yikeke Date: Fri, 29 May 2020 11:19:11 +0800 Subject: [PATCH 2/2] resolve conflicts --- tidb-specific-system-variables.md | 11 ----------- tiflash/tune-tiflash-performance.md | 15 --------------- 2 files changed, 26 deletions(-) diff --git a/tidb-specific-system-variables.md b/tidb-specific-system-variables.md index 1852015989fe..01371b79d5cc 100644 --- a/tidb-specific-system-variables.md +++ b/tidb-specific-system-variables.md @@ -768,7 +768,6 @@ TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在 这个变量用来显示上一个 `execute` 语句所使用的执行计划是不是直接从 plan cache 中取出来的。 -<<<<<<< HEAD ### ddl_slow_threshold 作用域:SESSION @@ -867,13 +866,10 @@ TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在 这个变量用来设置一天中允许自动演进的结束时间。 -======= ->>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) ### tidb_allow_batch_cop 从 v4.0 版本开始引入 作用域:SESSION | GLOBAL -<<<<<<< HEAD 默认值: 0 这个变量用于控制 TiDB 向 TiFlash 发送 coprocessor 请求的方式,有以下几种取值: @@ -953,10 +949,3 @@ TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在 默认值: 60 这个变量设置了查询 METRIC_SCHEMA 时生成的 Prometheus 语句的 range duration,单位为秒。 -======= -默认值:0 - -这个变量用来设置从 TiFlash 读取数据时,是否把 Region 的请求进行合并。 - -当查询的表拥有 TiFlash 副本,且查询涉及的 Region 数量比较多,可以尝试设置该变量为 `1`(对带 `aggregation` 下推到 TiFlash Coprocessor 的请求生效),或设置该变量为 `2`(对全部下推到 TiFlash Coprocessor 请求生效)。 ->>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) diff --git a/tiflash/tune-tiflash-performance.md b/tiflash/tune-tiflash-performance.md index 0d624e9f4704..b032a8a7e0e8 100644 --- a/tiflash/tune-tiflash-performance.md +++ b/tiflash/tune-tiflash-performance.md @@ -22,14 +22,9 @@ aliases: ['/docs-cn/stable/reference/tiflash/tune-performance/'] set @@tidb_distsql_scan_concurrency = 80; ``` -<<<<<<< HEAD 2. 开启 Super batch 功能: [`tidb_allow_batch_cop`](/tidb-specific-system-variables.md#tidb_allow_batch_cop) 变量用来设置从 TiFlash 读取时,是否把 Region 的请求进行合并。当查询中涉及的 Region 数量比较大,可以尝试设置该变量为 `1`(对带 `aggregation` 下推到 TiFlash Coprocessor 的请求生效),或设置该变量为 `2`(对全部下推到 TiFlash Coprocessor 请求生效)。 -======= -2. 开启 Super batch 功能: -[`tidb_allow_batch_cop`](/tidb-specific-system-variables.md#tidb_allow_batch_cop) 变量用来设置从 TiFlash 读取时,是否把 Region 的请求进行合并。当查询中涉及的 Region 数量比较大,可以尝试设置该变量为 `1`(对带 `aggregation` 下推到 TiFlash Coprocessor 的请求生效),或设置该变量为 `2`(对全部下推到 TiFlash Coprocessor 请求生效)。 ->>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) {{< copyable "sql" >}} @@ -37,14 +32,9 @@ aliases: ['/docs-cn/stable/reference/tiflash/tune-performance/'] set @@tidb_allow_batch_cop = 1; ``` -<<<<<<< HEAD 3. 尝试开启聚合推过 `Join` / `Union` 等 TiDB 算子的优化: [`tidb_opt_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_agg_push_down) 变量用来设置优化器是否执行聚合函数下推到 Join 之前的优化操作。当查询中聚合操作执行很慢时,可以尝试设置该变量为 1。 -======= -3. 尝试开启聚合推过 `Join` / `Union` 等 TiDB 算子的优化: -[`tidb_opt_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_agg_push_down) 变量用来设置优化器是否执行聚合函数下推到 Join 之前的优化操作。当查询中聚合操作执行很慢时,可以尝试设置该变量为 1。 ->>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) {{< copyable "sql" >}} @@ -52,14 +42,9 @@ aliases: ['/docs-cn/stable/reference/tiflash/tune-performance/'] set @@tidb_opt_agg_push_down = 1; ``` -<<<<<<< HEAD 4. 尝试开启 `Distince` 推过 `Join` / `Union` 等 TiDB 算子的优化: [`tidb_opt_distinct_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_distinct_agg_push_down) 变量用来设置优化器是否执行带有 `Distinct` 的聚合函数(比如 `select count(distinct a) from t`)下推到 Coprocessor 的优化操作。当查询中带有 `Distinct` 的聚合操作执行很慢时,可以尝试设置该变量为 `1`。 -======= -4. 尝试开启 `Distince` 推过 `Join` / `Union` 等 TiDB 算子的优化: -[`tidb_opt_distinct_agg_push_down`](/tidb-specific-system-variables.md#tidb_opt_distinct_agg_push_down) 变量用来设置优化器是否执行带有 `Distinct` 的聚合函数(比如 `select count(distinct a) from t`)下推到 Coprocessor 的优化操作。当查询中带有 `Distinct` 的聚合操作执行很慢时,可以尝试设置该变量为 `1`。 ->>>>>>> adaf792... Add explaination about tidb_allow_batch_cop (#3265) {{< copyable "sql" >}}