From b5adbca17dc476ee6edac7324100e14d7abfcdc2 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 653ad3615b35a..f932dc26e3168 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2613,6 +2613,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 0512fc06fe53a561fd21a67e71f1605b77ce52dc 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 f932dc26e3168..49fa1b187ebed 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2619,7 +2619,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