diff --git a/system-variables.md b/system-variables.md index 653ad3615b35a..49fa1b187ebed 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 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 - Scope: SESSION | GLOBAL