add docs for enforce mpp#5811
Conversation
|
|
||
| - Scope: SESSION | ||
| - Default value: `OFF` | ||
| - This variable is used to control whether to ignore the optimizer cost estimation, and to force the use of TiFlash's MPP mode to execute the queries. You can set the following values: |
There was a problem hiding this comment.
- comma "," is usually not used before "and" in a compound sentence.
- "to execute the queries" is a little redundant to me. Besides, "force to do sth" is more natural to me. How about "force to use TiFlash MPP mode"?
I'm not an English expert. These are only personal suggestions.
|
|
||
| ### `enforce-mpp` | ||
|
|
||
| + Determines whether to ignore the optimizer cost estimation, and force TiFlash's MPP mode to execute queries. |
| set @@session.tidb_enforce_mpp=0; | ||
| ``` | ||
|
|
||
| If you want to intelligently choose whether to use the MPP mode (by default) using the cost estimation of TiDB optimizer, you can execute the following statement: |
There was a problem hiding this comment.
This condition seems too long to read. How about replacing using the cost est of TiDB optimizer by 'by TiDB optimizer'? That makes sense to readers
| set @@session.tidb_enforce_mpp=0; | ||
| ``` | ||
|
|
||
| If you want TiDB to ignore the optimizer's cost estimates and force to choose the MPP mode, you can execute the following statement: |
| set @@session.tidb_enforce_mpp=1; | ||
| ``` | ||
|
|
||
| The initial value of the Session variable `tidb_enforce_mpp` is equal to the[`enforce-mpp`](/tidb-configuration-file.md#enforce-mpp) configuration item value of this tidb-server instance (which is `false` by default). In a TiDB cluster, if several tidb-server instances only perform analytical queries, to ensure that they can choose MPP mode, you can change their [`enforce-mpp`](/tidb-configuration-file.md#enforce-mpp) configuration value to `true`. |
There was a problem hiding this comment.
is "Session" need to capitalize the first letter?
There was a problem hiding this comment.
When I first read the sentence "In a TIDB cluster ...", I'm quite confused. I think you want to express "If you want to make several tidb servers only serve analytical quries in the cluster and to force them to use MPP mode," I think this way is clearer.
| > | ||
| > When `tidb_enforce_mpp=1` takes effect, the TiDB optimizer will ignore the cost estimation to choose MPP mode. However, TiDB will not choose the MPP mode if other factors that do not support the MPP mode occur, such as no TiFlash copy, the replication of TiFlash copies is not completed, and statements contain operators or functions that are not supported by the MPP mode. | ||
| > | ||
| > If the TiDB optimizer cannot select MPP mode due to reasons other than cost estimation, when you use the `EXPLAIN` statement to view the execution plan, a warning is returned to explain the reason, for example: |
There was a problem hiding this comment.
sorry to be frank, this sentence is quite messy, so I think we have to reorganize the sentence. How about "When TiDB optimizer choose non-MPP plan unexpectly, we can use explain statement to check out the plan and the warnings which explain why it doesn't apply MPP mode". For example
|
I think the use of "the" is not accurate in this document. We don't say "the TiFlash engine" or "the TiDB optimizer" because there is only one TiFlash engine and TiDB optimizer. I'm not English expert so that's only my intuition. |
|
|
||
| > **Note:** | ||
| > | ||
| > When `tidb_enforce_mpp=1` takes effect, the TiDB optimizer will ignore the cost estimation to choose MPP mode. However, TiDB will not choose the MPP mode if other factors that do not support the MPP mode occur, such as no TiFlash copy, the replication of TiFlash copies is not completed, and statements contain operators or functions that are not supported by the MPP mode. |
There was a problem hiding this comment.
It's not natural to use "copy" to describe the follower role in a cluster. The most often used term is "replica". "if other factors that do not support the MPP mode occur" is a little awkward. If I wrote it, I would say "However, there are still some cases that block MPP mode, such as missing TiFlash replica for some tables ..."
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
|
@TomShawn @hanfei1991 @LittleFall PTAL again, thx~ |
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
@hanfei1991: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
/remove-status LGT1 |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 559bf35 |
|
In response to a cherrypick label: new pull request created: #5819. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
add docs for enforce mpp
Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?