Skip to content

add docs for enforce mpp#5811

Merged
ti-chi-bot merged 20 commits into
pingcap:masterfrom
Joyinqin:add-mpp
Jun 22, 2021
Merged

add docs for enforce mpp#5811
ti-chi-bot merged 20 commits into
pingcap:masterfrom
Joyinqin:add-mpp

Conversation

@Joyinqin
Copy link
Copy Markdown
Contributor

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)

  • master (the latest development version)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 18, 2021
@ti-chi-bot ti-chi-bot requested a review from TomShawn June 18, 2021 10:02
@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 18, 2021
@Joyinqin Joyinqin added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v5.1 This PR/issue applies to TiDB v5.1. and removed missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 18, 2021
@Joyinqin Joyinqin requested a review from LittleFall June 18, 2021 10:03
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 18, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 21, 2021
@Joyinqin Joyinqin marked this pull request as ready for review June 21, 2021 03:11
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 21, 2021
Comment thread system-variables.md Outdated

- 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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. comma "," is usually not used before "and" in a compound sentence.
  2. "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.

Comment thread tidb-configuration-file.md Outdated

### `enforce-mpp`

+ Determines whether to ignore the optimizer cost estimation, and force TiFlash's MPP mode to execute queries.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and to force?

Comment thread tiflash/use-tiflash.md Outdated
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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread tiflash/use-tiflash.md Outdated
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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and to force?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statments?

Comment thread tiflash/use-tiflash.md Outdated
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`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "Session" need to capitalize the first letter?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tiflash/use-tiflash.md Outdated
>
> 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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@TomShawn TomShawn added the status/require-change Needs the author to address comments. label Jun 21, 2021
@hanfei1991
Copy link
Copy Markdown
Member

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.

Comment thread tiflash/use-tiflash.md Outdated

> **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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ..."

Joyinqin and others added 2 commits June 21, 2021 19:31
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
@Joyinqin
Copy link
Copy Markdown
Contributor Author

@TomShawn @hanfei1991 @LittleFall PTAL again, thx~

Comment thread system-variables.md Outdated
Comment thread tidb-configuration-file.md Outdated
Comment thread tiflash/use-tiflash.md Outdated
Comment thread tiflash/use-tiflash.md Outdated
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • TomShawn

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 22, 2021
@TomShawn TomShawn removed the status/require-change Needs the author to address comments. label Jun 22, 2021
Comment thread tiflash/use-tiflash.md Outdated
@TomShawn TomShawn requested a review from hanfei1991 June 22, 2021 08:42
@ti-chi-bot
Copy link
Copy Markdown
Member

@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.

Details

In 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.

@TomShawn
Copy link
Copy Markdown
Contributor

/remove-status LGT1
/status LGT2

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 22, 2021
@TomShawn
Copy link
Copy Markdown
Contributor

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 559bf35

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 22, 2021
@ti-chi-bot ti-chi-bot merged commit e0f8e00 into pingcap:master Jun 22, 2021
@ti-chi-bot ti-chi-bot mentioned this pull request Jun 22, 2021
12 tasks
@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created: #5819.

ti-chi-bot added a commit that referenced this pull request Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v5.1 This PR/issue applies to TiDB v5.1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants