From 9c612de1e305d0ebeca25030dce8c95e706ed589 Mon Sep 17 00:00:00 2001 From: qiancai Date: Tue, 22 Mar 2022 09:32:15 +0800 Subject: [PATCH 1/5] Update tidb-lightning-configuration.md --- tidb-lightning/tidb-lightning-configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index 28a36e469d2e9..6b1451ca941a1 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -262,6 +262,7 @@ trim-last-separator = false host = "172.16.31.1" port = 4000 user = "root" +# Configure the password to connect to TiDB. The password can be either plaintext or Base64 encoded. password = "" # Table schema information is fetched from TiDB via this status-port. status-port = 10080 @@ -440,7 +441,7 @@ min-available-ratio = 0.05 | --tidb-port *port* | TiDB server port (default = 4000) | `tidb.port` | | --tidb-status *port* | TiDB status port (default = 10080) | `tidb.status-port` | | --tidb-user *user* | User name to connect to TiDB | `tidb.user` | -| --tidb-password *password* | Password to connect to TiDB | `tidb.password` | +| --tidb-password *password* | Password to connect to TiDB. The password can be either plaintext or Base64 encoded. | `tidb.password` | | --no-schema | Ignore schema files, get schema directly from TiDB | `mydumper.no-schema` | | --enable-checkpoint *bool* | Whether to enable checkpoints (default = true) | `checkpoint.enable` | | --analyze *level* | Analyze tables after importing. Available values are "required", "optional" (default value), and "off" | `post-restore.analyze` | From 410d34d62321f60553e0655df1796fab7fb6f8f4 Mon Sep 17 00:00:00 2001 From: qiancai Date: Tue, 22 Mar 2022 10:30:31 +0800 Subject: [PATCH 2/5] Update statistics.md --- statistics.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/statistics.md b/statistics.md index 8438faaca751b..9ea88c640b198 100644 --- a/statistics.md +++ b/statistics.md @@ -331,7 +331,33 @@ When the ratio of the number of modified rows to the total number of rows of `tb > > Currently, the automatic update does not record the configuration items input at manual `ANALYZE`. Therefore, when you use the `WITH` syntax to control the collecting behavior of `ANALYZE`, you need to manually set scheduled tasks to collect statistics. -Before v5.0, when you execute a query, TiDB collects feedback with `feedback-probability` and updates the histogram and Count-Min Sketch based on the feedback. **Since v5.0, this feature is disabled by default, and it is not recommended to enable this feature.** +Before TiDB v5.0, when you execute a query, TiDB collects feedback with `feedback-probability` and updates the histogram and Count-Min Sketch based on the feedback. **Since v5.0, this feature is disabled by default, and it is not recommended to enable this feature.** + +Since TiDB v6.0, TiDB supports using the `KILL` statement to kill an `ANALYZE` task running in the background. If you find that an `ANALYZE` task running in the background consumes a lot of resources and affects your application, you can kill the `ANALYZE` task by taking the following steps: + +1. Execute the following SQL statement to get the address and task `ID` of the TiDB instance that is executing the background `ANALYZE` task: + + {{< copyable "sql" >}} + + ```sql + SELECT ci.instance as instance, cp.id as id FROM information_schema.cluster_info ci, information_schema.cluster_processlist cp WHERE ci.status_address = cp.instance and ci.type = 'tidb' and cp.info like 'analyze table %' and cp.user = '' and cp.host = ''; + ``` + + If there is no result, it indicates that no `ANALYZE` task is executing in the background. + +2. Use a client to connect to the TiDB instance that is executing the background `ANALYZE` task, and then execute the following `KILL` statement: + + {{< copyable "sql" >}} + + ```sql + KILL TIDB ${id}; + ``` + + `${id}` is the `ID` of the background `ANALYZE` task obtained from the query of the previous step. + + > **Note:** + > + > The above `KILL` statement only works on the TiDB instance that is executing the background `ANALYZE` task, so you must use a client to connect to that TiDB instance first. If you use a client to connect to another TiDB instance, or if there is a proxy between the client and TiDB, the `KILL` statement cannot kill the background `ANALYZE` task. For more information, see [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md). ### Control `ANALYZE` concurrency From a5aa443df04676f8f0a7ebe314e819b97761ead4 Mon Sep 17 00:00:00 2001 From: qiancai Date: Wed, 30 Mar 2022 11:14:27 +0800 Subject: [PATCH 3/5] Update statistics.md --- statistics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/statistics.md b/statistics.md index 9ea88c640b198..292b3e4284af9 100644 --- a/statistics.md +++ b/statistics.md @@ -333,7 +333,7 @@ When the ratio of the number of modified rows to the total number of rows of `tb Before TiDB v5.0, when you execute a query, TiDB collects feedback with `feedback-probability` and updates the histogram and Count-Min Sketch based on the feedback. **Since v5.0, this feature is disabled by default, and it is not recommended to enable this feature.** -Since TiDB v6.0, TiDB supports using the `KILL` statement to kill an `ANALYZE` task running in the background. If you find that an `ANALYZE` task running in the background consumes a lot of resources and affects your application, you can kill the `ANALYZE` task by taking the following steps: +Since TiDB v6.0, TiDB supports using the `KILL` statement to terminate an `ANALYZE` task running in the background. If you find that an `ANALYZE` task running in the background consumes a lot of resources and affects your application, you can terminate the `ANALYZE` task by taking the following steps: 1. Execute the following SQL statement to get the address and task `ID` of the TiDB instance that is executing the background `ANALYZE` task: @@ -357,7 +357,7 @@ Since TiDB v6.0, TiDB supports using the `KILL` statement to kill an `ANALYZE` t > **Note:** > - > The above `KILL` statement only works on the TiDB instance that is executing the background `ANALYZE` task, so you must use a client to connect to that TiDB instance first. If you use a client to connect to another TiDB instance, or if there is a proxy between the client and TiDB, the `KILL` statement cannot kill the background `ANALYZE` task. For more information, see [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md). + > The above `KILL` statement only works on the TiDB instance that is executing the background `ANALYZE` task, so you must use a client to connect to that TiDB instance first. If you use a client to connect to another TiDB instance, or if there is a proxy between the client and TiDB, the `KILL` statement cannot terminate the background `ANALYZE` task. For more information, see [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md). ### Control `ANALYZE` concurrency From b8483fc1429067b2dee5d402db39be06a5ce9a62 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Fri, 1 Apr 2022 01:08:25 +0800 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Yifan Xu <30385241+xuyifangreeneyes@users.noreply.github.com> Co-authored-by: shichun-0415 <89768198+shichun-0415@users.noreply.github.com> --- statistics.md | 10 +++++----- tidb-lightning/tidb-lightning-configuration.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/statistics.md b/statistics.md index 292b3e4284af9..a2f97db5ce008 100644 --- a/statistics.md +++ b/statistics.md @@ -335,7 +335,7 @@ Before TiDB v5.0, when you execute a query, TiDB collects feedback with `feedbac Since TiDB v6.0, TiDB supports using the `KILL` statement to terminate an `ANALYZE` task running in the background. If you find that an `ANALYZE` task running in the background consumes a lot of resources and affects your application, you can terminate the `ANALYZE` task by taking the following steps: -1. Execute the following SQL statement to get the address and task `ID` of the TiDB instance that is executing the background `ANALYZE` task: +1. Execute the following SQL statement to get the TiDB instance address and the `ID` of the background `ANALYZE` task: {{< copyable "sql" >}} @@ -343,9 +343,9 @@ Since TiDB v6.0, TiDB supports using the `KILL` statement to terminate an `ANALY SELECT ci.instance as instance, cp.id as id FROM information_schema.cluster_info ci, information_schema.cluster_processlist cp WHERE ci.status_address = cp.instance and ci.type = 'tidb' and cp.info like 'analyze table %' and cp.user = '' and cp.host = ''; ``` - If there is no result, it indicates that no `ANALYZE` task is executing in the background. + If there is no result, no `ANALYZE` task is running in the background. -2. Use a client to connect to the TiDB instance that is executing the background `ANALYZE` task, and then execute the following `KILL` statement: +2. Use a client to connect to the TiDB instance that is performing the background `ANALYZE` task, and then execute the following `KILL` statement: {{< copyable "sql" >}} @@ -353,11 +353,11 @@ Since TiDB v6.0, TiDB supports using the `KILL` statement to terminate an `ANALY KILL TIDB ${id}; ``` - `${id}` is the `ID` of the background `ANALYZE` task obtained from the query of the previous step. + `${id}` is the `ID` of the background `ANALYZE` task obtained in the previous step. > **Note:** > - > The above `KILL` statement only works on the TiDB instance that is executing the background `ANALYZE` task, so you must use a client to connect to that TiDB instance first. If you use a client to connect to another TiDB instance, or if there is a proxy between the client and TiDB, the `KILL` statement cannot terminate the background `ANALYZE` task. For more information, see [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md). + > The above `KILL` statement only works on a TiDB instance that is executing a background `ANALYZE` task. Therefore, you must use a client to connect to that TiDB instance first. If you use a client to connect to another TiDB instance, or if there is a proxy between the client and TiDB, the `KILL` statement cannot terminate the background `ANALYZE` task. For more information, see [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md). ### Control `ANALYZE` concurrency diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index 6b1451ca941a1..38ae9c563793f 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -262,7 +262,7 @@ trim-last-separator = false host = "172.16.31.1" port = 4000 user = "root" -# Configure the password to connect to TiDB. The password can be either plaintext or Base64 encoded. +# Configure the password to connect to TiDB. The password can either be plaintext or Base64 encoded. password = "" # Table schema information is fetched from TiDB via this status-port. status-port = 10080 @@ -441,7 +441,7 @@ min-available-ratio = 0.05 | --tidb-port *port* | TiDB server port (default = 4000) | `tidb.port` | | --tidb-status *port* | TiDB status port (default = 10080) | `tidb.status-port` | | --tidb-user *user* | User name to connect to TiDB | `tidb.user` | -| --tidb-password *password* | Password to connect to TiDB. The password can be either plaintext or Base64 encoded. | `tidb.password` | +| --tidb-password *password* | Password to connect to TiDB. The password can either be plaintext or Base64 encoded. | `tidb.password` | | --no-schema | Ignore schema files, get schema directly from TiDB | `mydumper.no-schema` | | --enable-checkpoint *bool* | Whether to enable checkpoints (default = true) | `checkpoint.enable` | | --analyze *level* | Analyze tables after importing. Available values are "required", "optional" (default value), and "off" | `post-restore.analyze` | From f9cd1cfb9e14499ed8bfbfc8dfde5b5beecd1e3c Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Fri, 1 Apr 2022 01:11:40 +0800 Subject: [PATCH 5/5] Apply suggestions from code review --- statistics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statistics.md b/statistics.md index a2f97db5ce008..94ef2ba2f0839 100644 --- a/statistics.md +++ b/statistics.md @@ -345,7 +345,7 @@ Since TiDB v6.0, TiDB supports using the `KILL` statement to terminate an `ANALY If there is no result, no `ANALYZE` task is running in the background. -2. Use a client to connect to the TiDB instance that is performing the background `ANALYZE` task, and then execute the following `KILL` statement: +2. Use a client to connect to the TiDB instance where the background `ANALYZE` task is running, and then execute the following `KILL` statement: {{< copyable "sql" >}}