Skip to content

Commit

Permalink
sysvar: update doc for tidb_opt_prefer_range_scan
Browse files Browse the repository at this point in the history
  • Loading branch information
en-jin19 committed Sep 6, 2021
1 parent 7f8909a commit 5b8fdb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1106,10 +1106,10 @@ mysql> desc select count(distinct a) from test.t;

### tidb_opt_prefer_range_scan <span class="version-mark">New in v5.0</span>

- Scope: SESSION
- Scope: SESSION | GLOBAL
- Default value: `OFF`
- After you set the value of this variable to `1`, the optimizer always prefers index scans over full table scans.
- In the following example, before you enable `tidb_opt_prefer_range_scan`, the TiDB optimizer performs a full table scan. After you enable `tidb_opt_prefer_range_scan`, the optimizer selects an index scan.
- After you set the value of this variable to `ON`, the optimizer always prefers range scans over full table scans.
- In the following example, before you enable `tidb_opt_prefer_range_scan`, the TiDB optimizer performs a full table scan. After you enable `tidb_opt_prefer_range_scan`, the optimizer selects an index range scan.

```sql
explain select * from t where age=5;
Expand Down

0 comments on commit 5b8fdb3

Please sign in to comment.