Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add document for explain/explain analyze of mpp query. #5754

Merged
merged 34 commits into from
Mar 24, 2021

Conversation

windtalker
Copy link
Contributor

@windtalker windtalker commented Mar 17, 2021

First-time contributors' checklist

What is changed, added or deleted? (Required)

This pr add document for explain/explain analyze of mpp query.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • 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)?

  • This PR is translated from:
  • Other reference 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 missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 17, 2021
@windtalker windtalker changed the title add explain/explain analyze for mpp add document for explain/explain analyze of mpp query. Mar 17, 2021
@windtalker
Copy link
Contributor Author

/cc @ilovesoup

@ti-chi-bot ti-chi-bot requested a review from ilovesoup March 17, 2021 04:56
@TomShawn
Copy link
Contributor

/label needs-cherry-pick-5.0

@TomShawn
Copy link
Contributor

/status PTAL
/size large
/translation doing
/assign
/cc XuHuaiyu

@ti-chi-bot ti-chi-bot added status/PTAL This PR is ready for reviewing. size/large Changes of a large size. labels Mar 17, 2021
@ti-chi-bot ti-chi-bot requested a review from XuHuaiyu March 17, 2021 06:22
@ti-chi-bot ti-chi-bot added translation/doing This PR’s assignee is translating this PR. and removed missing-translation-status This PR does not have translation status info. labels Mar 17, 2021
@TomShawn
Copy link
Contributor

/label v5.0

@ti-chi-bot ti-chi-bot added the v5.0 This PR/issue applies to TiDB v5.0 label Mar 17, 2021
TOC.md Outdated
@@ -102,6 +102,14 @@
+ [SQL 性能调优概览](/sql-tuning-overview.md)
+ 理解 TiDB 执行计划
+ [TiDB 执行计划概览](/explain-overview.md)
+ [TiDB 执行计划 walkthrough](/explain-walkthrough.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

These documents are added to TOC in https://github.com/pingcap/docs-cn/pull/5561/files. PTAL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I will delete these change in my PR, but when will that pr be merged? Looks like no one has dealt with that pr for 11 days.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about using the added TOC entries in #5561 without waiting for #5561's merge? Personally, I think they are more expressive. If you think any modification is needed, feel free to apply it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean not change TOC.md in this pr, just updating #5561 after this pr is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe just merge this pr, and let the owner of #5561 to resolve the conflict?

Copy link
Contributor

@TomShawn TomShawn Mar 19, 2021

Choose a reason for hiding this comment

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

"You mean not change TOC.md in this pr, just updating #5561 after this pr is merged?"

Good idea! We just need to add "TiDB mpp 执行计划" in this PR and leave other things to 5561. So this PR is not blocked by 5561.

Copy link
Contributor Author

@windtalker windtalker Mar 19, 2021

Choose a reason for hiding this comment

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

OK, I've remove TOC related changes, I think it is ready to be merged, PTAL

Copy link
Contributor

@TomShawn TomShawn Mar 19, 2021

Choose a reason for hiding this comment

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

No. You still need to add this doc to TOC in this PR. Otherwise, users cannot find this doc on the left navigation menu of the PingCAP doc site. What about MPP 模式查询的执行计划

explain-mpp.md Outdated
+------------------------------------+---------+---------+-------------------+---------------+---------------------------------------------------------------------------------------------+----------------------------------------------------------------+--------+------+
```

与 explain 相比,ExchangeSender 的 operator info 中多了 task id 的输出,其记录了该 query fragment 实例化成的 MPP Task 的 task id,此外 MPP Executor 中都会有 `threads` 这一列,这列记录了 MPP 在执行该算子时使用的并发数(对于有多个节点组成的集群,改并发数是所有节点并发数相加的结果)。
Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide an sample of join.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@windtalker, we need to complete the CN docs today. PTAL, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean this pr should be merged today? Currently it is blocked by #5702 and #5561

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not blocked by #5561. For #5702, the content is ready for merge. This PR should be merged after #5702.

Copy link
Contributor

@ilovesoup ilovesoup left a comment

Choose a reason for hiding this comment

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

LGTM except need an sample of join with shuffle.

@ti-chi-bot
Copy link
Member

@ilovesoup: /lgtm is only allowed for the reviewers in list.

In response to this:

LGTM except need an sample of join with shuffle.

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.

@XuHuaiyu
Copy link
Contributor

/lgtm

@ti-chi-bot
Copy link
Member

@XuHuaiyu: /lgtm is only allowed for the reviewers in list.

In response to this:

/lgtm

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.

@windtalker
Copy link
Contributor Author

Currently blocked by #5702 and #5561

@ti-chi-bot ti-chi-bot removed the size/large Changes of a large size. label Mar 19, 2021
explain-mpp.md Outdated
+------------------------------------+---------+---------+-------------------+---------------+---------------------------------------------------------------------------------------------+----------------------------------------------------------------+--------+------+
```

与 explain 相比,ExchangeSender 的 operator info 中多了 task id 的输出,其记录了该 query fragment 实例化成的 MPP Task 的 task id,此外 MPP Executor 中都会有 `threads` 这一列,这列记录了 MPP 在执行该算子时使用的并发数(对于有多个节点组成的集群,改并发数是所有节点并发数相加的结果)。
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not blocked by #5561. For #5702, the content is ready for merge. This PR should be merged after #5702.

explain-mpp.md Outdated
SET tidb_allow_mpp = 1;
```

## MPP query fragment 和 MPP task
Copy link
Contributor

Choose a reason for hiding this comment

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

是否有对应的中文写法?比如 MPP 查询分片,MPP 任务?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

有的,我改一下

explain-mpp.md Outdated
+------------------------------------+---------+---------+-------------------+---------------+---------------------------------------------------------------------------------------------+----------------------------------------------------------------+--------+------+
```

与 explain 相比,ExchangeSender 的 operator info 中多了 task id 的输出,其记录了该 query fragment 实例化成的 MPP Task 的 task id,此外 MPP Executor 中都会有 `threads` 这一列,这列记录了 MPP 在执行该算子时使用的并发数(对于有多个节点组成的集群,改并发数是所有节点并发数相加的结果)。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
explain 相比,ExchangeSender 的 operator info 中多了 task id 的输出,其记录了该 query fragment 实例化成的 MPP Task 的 task id此外 MPP Executor 中都会有 `threads` 这一列,这列记录了 MPP 在执行该算子时使用的并发数(对于有多个节点组成的集群,改并发数是所有节点并发数相加的结果)。
`EXPLAIN` 的输出结果相比,ExchangeSender 的 operator info 列中多了 task id 的输出,记录了该 query fragment 实例化成的 MPP Task 的 task id此外 MPP Operator 中都会有 `threads` 这一列,这列记录了 MPP 在执行该算子时使用的并发数(对于由多个节点组成的集群,该并发数是所有节点并发数相加的结果)。

@TomShawn
Copy link
Contributor

/remove-status PTAL
/status require-change

@ti-chi-bot ti-chi-bot added the status/require-change Needs the author to address comments. label Mar 19, 2021
@ti-chi-bot
Copy link
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.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 23, 2021
@TomShawn
Copy link
Contributor

/remove-status require-change

@ti-chi-bot ti-chi-bot removed the status/require-change Needs the author to address comments. label Mar 23, 2021
@TomShawn
Copy link
Contributor

/unassign
/assign @CharLotteiu

@ti-chi-bot ti-chi-bot assigned CharLotteiu and unassigned TomShawn Mar 24, 2021
@TomShawn
Copy link
Contributor

/label require-LGT1

@ti-chi-bot ti-chi-bot added the require-LGT1 Indicates that the PR requires an LGTM. label Mar 24, 2021
@TomShawn
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 52bd904

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 24, 2021
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 24, 2021
@XuHuaiyu
Copy link
Contributor

/lgtm

@ti-chi-bot
Copy link
Member

@XuHuaiyu: /lgtm is only allowed for the reviewers in list.

In response to this:

/lgtm

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
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 870bb10

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 24, 2021
@ti-chi-bot ti-chi-bot merged commit a45c36a into pingcap:master Mar 24, 2021
ti-srebot pushed a commit to ti-srebot/docs-cn that referenced this pull request Mar 24, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #5825

@CharLotteiu
Copy link
Contributor

/remove-translation doing
/translation done

@ti-chi-bot ti-chi-bot added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Mar 25, 2021
{{< copyable "sql" >}}

```sql
SET tidb_opt_broadcast_join=0; SET tidb_broadcast_join_threshold_count=0; SET tidb_broadcast_join_threshold_size=0; EXPLAIN SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.id = b.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

SET tidb_opt_broadcast_join=0;
SET tidb_broadcast_join_threshold_count=0;
SET tidb_broadcast_join_threshold_size=0;
EXPLAIN SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.id = b.id;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
require-LGT1 Indicates that the PR requires an LGTM. 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/LGT1 Indicates that a PR has LGTM 1. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v5.0 This PR/issue applies to TiDB v5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants