From b0a18aff68127b433c097fbd415acad4d54e70aa 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 62f4c6f1d7efd..09cc486e79b05 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2612,6 +2612,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 078022c4e48ea3399d44ee2f6dfdbc0348840334 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 09cc486e79b05..c6e712bca5c53 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2618,7 +2618,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