Skip to content

Commit

Permalink
Update system-variables.md (#18035) (#18110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jul 4, 2024
1 parent fae0748 commit 6f2f8fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,8 @@ Constraint checking is always performed in place for pessimistic transactions (d
- Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios.
- For OLAP scenarios, the maximum value should not exceed the number of CPU cores of all the TiKV nodes.
- If a table has a lot of partitions, you can reduce the variable value appropriately (determined by the size of the data to be scanned and the frequency of the scan) to avoid TiKV becoming out of memory (OOM).
- For a simple query with only a `LIMIT` clause, if the `LIMIT` value is less than 100000, the scan operation pushed down to TiKV treats the value of this variable as `1` to enhance execution efficiency.
- For the `SELECT MAX/MIN(col) FROM ...` query, if the `col` column has an index sorted in the same order required by the `MAX(col)` or `MIN(col)` function, TiDB will rewrite the query to `SELECT col FROM ... LIMIT 1` for processing, and the value of this variable will also be processed as `1`. For example, for `SELECT MIN(col) FROM ...`, if the `col` column has an ascending index, TiDB can quickly obtain the `MIN(col)` value by rewriting the query to `SELECT col FROM ... LIMIT 1` and directly reading the first row of the index.
### tidb_dml_batch_size
Expand Down

0 comments on commit 6f2f8fb

Please sign in to comment.