From 159ec82289fb9c761215ec51037ee68524676851 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 b031608566246..96c6e591e9946 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2276,6 +2276,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 4fc62a1bff8b5c6b1ad2b266197fa900d4ba4d02 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 96c6e591e9946..05a7464dc2ea0 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2282,7 +2282,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