From 5651b0ec5452835c1d50544ba84b57bc4c41072c Mon Sep 17 00:00:00 2001 From: yikeke Date: Tue, 28 Aug 2018 13:34:32 +0800 Subject: [PATCH 1/2] sql: add new tidb specific system variables Via: https://github.com/pingcap/docs-cn/pull/852/ --- sql/tidb-specific.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sql/tidb-specific.md b/sql/tidb-specific.md index 5ecbb627d6856..43290b768e214 100644 --- a/sql/tidb-specific.md +++ b/sql/tidb-specific.md @@ -116,6 +116,26 @@ set @@global.tidb_distsql_scan_concurrency = 10 - This variable is used to set the concurrency of the `serial scan` operation. - Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios. +### tidb_projection_concurrency + +- Scope: SESSION | GLOBAL +- Default value: 4 +- This variable is used to set the concurrency of the `Projection` operator. + +### tidb_hashagg_partial_concurrency + +- Scope: SESSION | GLOBAL +- Default value: 4 +- This variable is used to set the concurrency of executing the concurrent `hash aggregation` algorithm in the `partial` phase. +- When the parameter of the aggregate function is not distinct, HashAgg is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. + +### tidb_hashagg_final_concurrency + +- Scope: SESSION | GLOBAL +- Default value: 4 +- This variable is used to set the concurrency of executing the concurrent `hash aggregation` algorithm in the `final` phase. +- When the parameter of the aggregate function is not distinct, HashAgg is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. + ### tidb_index_join_batch_size - Scope: SESSION | GLOBAL @@ -237,6 +257,31 @@ set @@global.tidb_distsql_scan_concurrency = 10 - Default: 0 - This variable is used to set whether to disable automatic retry of explicit transactions. If you set this variable to 1, the transaction does not retry automatically. If there is a conflict, the transaction needs to be retried at the application layer. To decide whether you need to disable automatic retry, see [description of optimistic transactions](transaction-isolation.md#description-of-optimistic-transactions). +## tidb_enable_table_partition + +- Scope: SESSION +- Default value: 0 +- This variable is used to set whether to enable the `TABLE PARTITION` feature. + +## tidb_backoff_lock_fast + +- Scope: SESSION | GLOBAL +- Default value: 100 +- This variable is used to set the `backoff` time when the read request meets a lock. + +## tidb_ddl_reorg_worker_cnt + +- Scope: SESSION | GLOBAL +- Default value: 16 +- This variable is used to set the concurrency of the DDL operation in the `re-organize` phase. + +## tidb_ddl_reorg_priority + +- Scope: SESSION | GLOBAL +- Default value: PRIORITY_NORMAL +- This variable is used to set the priority of executing the `ADD INDEX` operation in the `re-organize` phase. +- You can set the value of this variable to PRIORITY_LOW, PRIORITY_NORMAL or PRIORITY_HIGH. + ## 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. From dde91be4147ef79a47730f9d98ce863d5c709d2e Mon Sep 17 00:00:00 2001 From: yikeke Date: Wed, 29 Aug 2018 10:55:40 +0800 Subject: [PATCH 2/2] sql: address the comment --- sql/tidb-specific.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/tidb-specific.md b/sql/tidb-specific.md index 43290b768e214..eb21d17ce9512 100644 --- a/sql/tidb-specific.md +++ b/sql/tidb-specific.md @@ -127,14 +127,14 @@ set @@global.tidb_distsql_scan_concurrency = 10 - Scope: SESSION | GLOBAL - Default value: 4 - This variable is used to set the concurrency of executing the concurrent `hash aggregation` algorithm in the `partial` phase. -- When the parameter of the aggregate function is not distinct, HashAgg is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. +- When the parameter of the aggregate function is not distinct, `HashAgg` is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. ### tidb_hashagg_final_concurrency - Scope: SESSION | GLOBAL - Default value: 4 - This variable is used to set the concurrency of executing the concurrent `hash aggregation` algorithm in the `final` phase. -- When the parameter of the aggregate function is not distinct, HashAgg is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. +- When the parameter of the aggregate function is not distinct, `HashAgg` is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. ### tidb_index_join_batch_size @@ -278,9 +278,9 @@ set @@global.tidb_distsql_scan_concurrency = 10 ## tidb_ddl_reorg_priority - Scope: SESSION | GLOBAL -- Default value: PRIORITY_NORMAL +- Default value: `PRIORITY_NORMAL` - This variable is used to set the priority of executing the `ADD INDEX` operation in the `re-organize` phase. -- You can set the value of this variable to PRIORITY_LOW, PRIORITY_NORMAL or PRIORITY_HIGH. +- You can set the value of this variable to `PRIORITY_LOW`, `PRIORITY_NORMAL` or `PRIORITY_HIGH`. ## Optimizer Hint