From d21c18034de156a8a8c42f8c8a4af2496246332c Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Wed, 13 Dec 2023 12:16:49 +0800 Subject: [PATCH] add doc for tidb_allow_tiflash_cop (#15667) --- releases/release-7.3.0.md | 1 + system-variables.md | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/releases/release-7.3.0.md b/releases/release-7.3.0.md index dc3ab1152cc16..269a4761bcb25 100644 --- a/releases/release-7.3.0.md +++ b/releases/release-7.3.0.md @@ -175,6 +175,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.3/quick-start-with- | Variable name | Change type | Description | |--------|------------------------------|------| | [`tidb_opt_enable_mpp_shared_cte_execution`](/system-variables.md#tidb_opt_enable_mpp_shared_cte_execution-new-in-v720) | Modified | This system variable takes effect starting from v7.3.0. It controls whether non-recursive Common Table Expressions (CTEs) can be executed in TiFlash MPP. | +| [`tidb_allow_tiflash_cop`](/system-variables.md#tidb_allow_tiflash_cop-new-in-v730) | Newly added | This system variable is used to select the protocol for generating execution plans when TiDB pushes computation tasks down to TiFlash. | | [`tidb_lock_unchanged_keys`](/system-variables.md#tidb_lock_unchanged_keys-new-in-v711-and-v730) | Newly added | This variable is used to control in certain scenarios whether to lock the keys that are involved but not modified in a transaction. | | [`tidb_opt_enable_non_eval_scalar_subquery`](/system-variables.md#tidb_opt_enable_non_eval_scalar_subquery-new-in-v730) | Newly added | Controls whether the `EXPLAIN` statement disables the execution of constant subqueries that can be expanded at the optimization stage. | | [`tidb_skip_missing_partition_stats`](/system-variables.md#tidb_skip_missing_partition_stats-new-in-v730) | Newly added | This variable controls the generation of GlobalStats when partition statistics are missing. | diff --git a/system-variables.md b/system-variables.md index 7f28e6d780164..79f72f4c64a8d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1009,6 +1009,17 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count'; - Unit: Bytes - This variable is used to control the threshold at which the TiDB server prefers to send read requests to a replica in the same availability zone as the TiDB server when [`tidb_replica_read`](#tidb_replica_read-new-in-v40) is set to `closest-adaptive`. If the estimated result is higher than or equal to this threshold, TiDB prefers to send read requests to a replica in the same availability zone. Otherwise, TiDB sends read requests to the leader replica. +### tidb_allow_tiflash_cop New in v7.3.0 + +- Scope: SESSION | GLOBAL +- Persists to cluster: Yes +- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No +- Type: Boolean +- Default value: `OFF` +- When TiDB pushes computation tasks down to TiFlash, there are three methods (or protocols) to choose from: Cop, BatchCop, and MPP. Compared to Cop and BatchCop, the MPP protocol is more mature and offers better task and resource management. Therefore, it is recommended to use the MPP protocol. + - `0` or `OFF`: the optimizer only generates plans using the TiFlash MPP protocol. + - `1` or `ON`: the optimizer determines whether to use the Cop, BatchCop, or MPP protocol to generate execution plans based on the cost estimation. + ### tidb_allow_batch_cop New in v4.0 - Scope: SESSION | GLOBAL