Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#6718
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
TomShawn authored and ti-chi-bot committed Jul 23, 2021
1 parent d87298b commit f206675
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sql-statements/sql-statement-show-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ SHOW GLOBAL VARIABLES LIKE 'tidb%';
| tidb_stmt_summary_history_size | 24 |
| tidb_stmt_summary_internal_query | 0 |
| tidb_stmt_summary_max_sql_length | 4096 |
| tidb_stmt_summary_max_stmt_count | 200 |
| tidb_stmt_summary_max_stmt_count | 3000 |
| tidb_stmt_summary_refresh_interval | 1800 |
| tidb_store_limit | 0 |
| tidb_txn_mode | |
Expand Down
2 changes: 1 addition & 1 deletion statement-summary-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ select * from employee where id in (...) and salary between ? and ?;
- `tidb_enable_stmt_summary`:是否打开 statement summary 功能。1 代表打开,0 代表关闭,默认打开。statement summary 关闭后,系统表里的数据会被清空,下次打开后重新统计。经测试,打开后对性能几乎没有影响。
- `tidb_stmt_summary_refresh_interval``statements_summary` 的清空周期,单位是秒 (s),默认值是 `1800`
- `tidb_stmt_summary_history_size``statements_summary_history` 保存每种 SQL 的历史的数量,默认值是 `24`
- `tidb_stmt_summary_max_stmt_count`:statement summary tables 保存的 SQL 种类数量,默认 200 条。当 SQL 种类超过该值时,会移除最近没有使用的 SQL。
- `tidb_stmt_summary_max_stmt_count`:statement summary tables 保存的 SQL 种类数量。v4.0.14 前,默认 200 条。自 v4.0.14,默认 3000 条。当 SQL 种类超过该值时,会移除最近没有使用的 SQL。
- `tidb_stmt_summary_max_sql_length`:字段 `DIGEST_TEXT``QUERY_SAMPLE_TEXT` 的最大显示长度,默认值是 4096。
- `tidb_stmt_summary_internal_query`:是否统计 TiDB 的内部 SQL。1 代表统计,0 代表不统计,默认不统计。

Expand Down
6 changes: 6 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,14 @@ set tidb_slow_log_threshold = 200;
### `tidb_stmt_summary_max_stmt_count` <span class="version-mark">从 v4.0 版本开始引入</span>

- 作用域:SESSION | GLOBAL
<<<<<<< HEAD
- 默认值:`200`
- 范围:`[1, 32767]`
=======

- 默认值:v4.0.14 前为 200。自 v4.0.14 起为 3000(受配置文件影响,这里给出的是默认配置文件取值)

>>>>>>> c9dd5a125 (Update the default value of tidb_stmt_summary_max_stmt_count (#6718))
- 这个变量设置了 statement summary 在内存中保存的语句的最大数量。

### `tidb_stmt_summary_refresh_interval` <span class="version-mark">从 v4.0 版本开始引入</span>
Expand Down

0 comments on commit f206675

Please sign in to comment.