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

explain: add hint about disabling line wrapping with less #5349

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Apr 15, 2021

What is changed, added or deleted? (Required)

Add a hint to the EXPLAIN documentation about how to use less -S to view large explain output without line wrapping.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 15, 2021
@@ -6,6 +6,10 @@ aliases: ['/docs/dev/query-execution-plan/','/docs/dev/reference/performance/und

# `EXPLAIN` Overview

> **Note:**
>
> If you use the `mysql` client to connect to TiDB you may want to use `pager less -S` to avoid line wrapping in your terminal and instead press the right arrow on your keyboard to horizontally scroll through the explain output.
Copy link
Contributor

@TomShawn TomShawn Apr 16, 2021

Choose a reason for hiding this comment

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

  • pager less -S and "the right arrow on your keyboard" are used together?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how this works:

mysql> pager less -S
mysql> EXPLAIN ANALYZE SELECT.....

The output is shown in less and instead of wrapping lines it chops off the part that doesn't fit on the screen. Then by pressing the right arrow key on the keyboard you can 'scroll' to the right. Here \G in MySQL doesn't help.

Example w/o this:
image

Example with less -S:
image

Here you can see that less indicates there is more output on the right with >. The output can be viewed by pressing the right arrow key on the keyboard.

This improves the output of the tree-like explain output that is in the id column of the explain output.

@TomShawn
Copy link
Contributor

/cc @morgo
/assign Joyinqin
/label needs-cherry-pick-4.0
/label needs-cherry-pick-5.0
/translation doing

@ti-chi-bot ti-chi-bot added translation/doing This PR's assignee is translating this PR. needs-cherry-pick-4.0 labels Apr 16, 2021
@ti-chi-bot ti-chi-bot requested a review from morgo April 16, 2021 02:20
@ti-chi-bot ti-chi-bot added needs-cherry-pick-5.0 and removed missing-translation-status This PR does not have translation status info. labels Apr 16, 2021
@morgo
Copy link
Contributor

morgo commented Apr 16, 2021

/LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 16, 2021
explain-overview.md Outdated Show resolved Hide resolved
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
@TomShawn
Copy link
Contributor

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • TomShawn
  • morgo

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 16, 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: 1ef541e

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

cherry pick to release-4.0 in PR #5376

ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Apr 16, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #5377

@TomShawn
Copy link
Contributor

/label requires-followup
Follow-up: update Line 33 in sql-statements/sql-statement-explain.md in master.

@ti-chi-bot ti-chi-bot added the requires-followup This PR requires a follow-up task after being merged. label Apr 19, 2021
@Joyinqin
Copy link
Contributor

/translation done
/remove-translation doing

@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 Apr 20, 2021
@Joyinqin
Copy link
Contributor

/label requires-followup
Follow-up: update Line 33 in sql-statements/sql-statement-explain.md in master.

Done in #5407

@Joyinqin
Copy link
Contributor

/remove-label requires-followup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants