From 61976b736ae682e0416a3ee9c934dcf96c4aa8c4 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Thu, 14 Jun 2018 11:17:21 +0800 Subject: [PATCH 1/2] sql: add tidb_retry_limit --- sql/tidb-specific.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sql/tidb-specific.md b/sql/tidb-specific.md index d69702b75180b..6e1e7ec143adf 100644 --- a/sql/tidb-specific.md +++ b/sql/tidb-specific.md @@ -8,14 +8,19 @@ category: user guide On the basis of MySQL variables and syntaxes, TiDB has defined some specific system variables and syntaxes to optimize performance. ## System variable + Variables can be set with the `SET` statement, for example: -```set @@tidb_distsql_scan_concurrency = 10 ``` +``` +set @@tidb_distsql_scan_concurrency = 10 +``` If you need to set the global variable, run: -```set @@global.tidb_distsql_scan_concurrency = 10 ``` - +``` +set @@global.tidb_distsql_scan_concurrency = 10 +``` + ### tidb_snapshot - Scope: SESSION @@ -218,8 +223,15 @@ If you need to set the global variable, run: - Scope: SERVER - Default value: 0 - This variable is used to set whether to enable Streaming. - -## Optimizer hint + +## tidb_retry_limit + +- Scope: SESSION | GLOBAL +- Default value: 10 +- When a transaction encounters errors that support retries, such as transaction conflicts and TiKV busy, this transaction can be re-executed. This variable is used to set the maximum number of the retries. + +## Optimizer Hint + On the basis of MySQL’s `Optimizer Hint` Syntax, TiDB adds some proprietary `Hint` syntaxes. When using the `Hint` syntax, the TiDB optimizer will try to use the specific algorithm, which performs better than the default algorithm in some scenarios. The `Hint` syntax is included in comments like `/*+ xxx */`, and in MySQL client versions earlier than 5.7.7, the comment is removed by default. If you want to use the `Hint` syntax in these earlier versions, add the `--comments` option when starting the client. For example: `mysql -h 127.0.0.1 -P 4000 -uroot --comments`. From 9a3ffdea1dfc73ad2624721437a24c4e56762951 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Thu, 14 Jun 2018 16:42:43 +0800 Subject: [PATCH 2/2] sql: address the comment --- sql/tidb-specific.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/tidb-specific.md b/sql/tidb-specific.md index 6e1e7ec143adf..e05f6b6eb4bd2 100644 --- a/sql/tidb-specific.md +++ b/sql/tidb-specific.md @@ -228,7 +228,7 @@ set @@global.tidb_distsql_scan_concurrency = 10 - Scope: SESSION | GLOBAL - Default value: 10 -- When a transaction encounters errors that support retries, such as transaction conflicts and TiKV busy, this transaction can be re-executed. This variable is used to set the maximum number of the retries. +- When a transaction encounters retriable errors, such as transaction conflicts and TiKV busy, this transaction can be re-executed. This variable is used to set the maximum number of the retries. ## Optimizer Hint