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

planner: support JSON format explain #12102

Merged
merged 17 commits into from
Dec 6, 2022
Merged

Conversation

fzzf678
Copy link
Contributor

@fzzf678 fzzf678 commented Nov 24, 2022

First-time contributors' checklist

What is changed, added or deleted? (Required)

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

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v6.5 (TiDB 6.5 versions)
  • v6.4 (TiDB 6.4 versions)
  • v6.3 (TiDB 6.3 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 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
Copy link
Member

ti-chi-bot commented Nov 24, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • qiancai
  • ran-huang

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@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 Nov 24, 2022
@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 Nov 24, 2022
@ran-huang ran-huang requested review from ran-huang and removed request for TomShawn November 25, 2022 06:30
@ran-huang ran-huang added area/planner Indicates that the Issue or PR belongs to the area of SQL planner or optimizer. v6.5 This PR/issue applies to TiDB v6.5. labels Nov 25, 2022
@qiancai qiancai added the translation/doing This PR’s assignee is translating this PR. label Nov 25, 2022
@ti-chi-bot ti-chi-bot removed the missing-translation-status This PR does not have translation status info. label Nov 25, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 25, 2022
@fzzf678 fzzf678 marked this pull request as ready for review November 29, 2022 02:31
@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 Nov 29, 2022
sql-statements/sql-statement-explain.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-explain.md Outdated Show resolved Hide resolved
@@ -185,12 +185,13 @@ EXPLAIN DELETE FROM t1 WHERE c1=3;

在 `EXPLAIN` 中使用 `FORMAT = "xxx"` 语法可以指定输出的内容和格式。
Copy link
Contributor

Choose a reason for hiding this comment

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

建议把这里的几种格式示例写成 tab 形式, @fzzf678 你觉得呢?可以的话我先这样改
image

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@fzzf678
Copy link
Contributor Author

fzzf678 commented Nov 30, 2022

@ran-huang some line changed, PTAL again.

Copy link
Contributor

@ran-huang ran-huang left a comment

Choose a reason for hiding this comment

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

rest LGTM


## MySQL 兼容性

* `EXPLAIN` 的格式和 TiDB 中潜在的执行计划都与 MySQL 有很大不同。
* TiDB 不支持 `FORMAT=TREE` 选项。
* TiDB 不支持 `FORMAT=JSON` 或 `FORMAT=TREE` 选项。
Copy link
Contributor

Choose a reason for hiding this comment

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

这里要说明一下吗,如果需要输出为 JSON 请使用 tidb_json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tidb_json 和Mysql的 JSON 输出字段还不一样 ,FORMAT=JSON 打算后面给兼容MySQL时候用

Signed-off-by: Ran <huangran.alex@gmail.com>
sql-statements/sql-statement-explain.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-explain.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-explain.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-explain.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-explain.md Show resolved Hide resolved
fzzf678 and others added 4 commits December 1, 2022 16:04
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 1, 2022
@ran-huang ran-huang added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed translation/doing This PR’s assignee is translating this PR. labels Dec 1, 2022
Copy link
Collaborator

@qiancai qiancai 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 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 Dec 2, 2022
@ran-huang
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 73c7eb6

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 2, 2022
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Dec 5, 2022
@ran-huang ran-huang removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 5, 2022
Co-authored-by: Grace Cai <qqzczy@126.com>
Copy link
Collaborator

@qiancai qiancai left a comment

Choose a reason for hiding this comment

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

LGTM

@ran-huang
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 9edd526

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 6, 2022
@ti-chi-bot ti-chi-bot merged commit 6593a9c into pingcap:master Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/planner Indicates that the Issue or PR belongs to the area of SQL planner or optimizer. size/M Denotes a PR that changes 30-99 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/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v6.5 This PR/issue applies to TiDB v6.5.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants