From b4d0d71e747dd2bf76745c1062ba49360baa6051 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 13 Oct 2022 13:42:42 +0800 Subject: [PATCH 1/2] sysvar: add 1 var --- system-variables.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system-variables.md b/system-variables.md index c0ad3386b0132..25839825d8c48 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2410,6 +2410,15 @@ mysql> desc select count(distinct a) from test.t; select t.* from t, t1 where t.a=t1.aa; ``` +### tidb_opt_join_reorder_threshold + +- Scope: SESSION | GLOBAL +- Persists to cluster: Yes +- Default value: `0` +- Range: `[0, 2147483647]` +- This variable is used to control the selection of the TiDB Join Reorder algorithm. When the number of nodes participating in Join Reorder is greater than the threshold, TiDB selects the greedy algorithm, and when it is less than the threshold, TiDB selects the dynamic programming algorithm. +- Currently, for OLTP queries, it is recommended to keep the default value. For OLAP queries, it is recommended to set the variable value to 10~15 to get better connection orders in OLAP scenarios. + ### tidb_opt_limit_push_down_threshold - Scope: SESSION | GLOBAL From c3f8f80a5ac1d38653e09e55128a2eb27f82dbcf Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 14 Oct 2022 19:05:05 +0800 Subject: [PATCH 2/2] Update system-variables.md Co-authored-by: shichun-0415 <89768198+shichun-0415@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 25839825d8c48..5eca40c968087 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2416,7 +2416,7 @@ mysql> desc select count(distinct a) from test.t; - Persists to cluster: Yes - Default value: `0` - Range: `[0, 2147483647]` -- This variable is used to control the selection of the TiDB Join Reorder algorithm. When the number of nodes participating in Join Reorder is greater than the threshold, TiDB selects the greedy algorithm, and when it is less than the threshold, TiDB selects the dynamic programming algorithm. +- This variable is used to control the selection of the TiDB Join Reorder algorithm. When the number of nodes participating in Join Reorder is greater than this threshold, TiDB selects the greedy algorithm, and when it is less than this threshold, TiDB selects the dynamic programming algorithm. - Currently, for OLTP queries, it is recommended to keep the default value. For OLAP queries, it is recommended to set the variable value to 10~15 to get better connection orders in OLAP scenarios. ### tidb_opt_limit_push_down_threshold