-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: record and print the plan in slow log. (#12179) #13297
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bb7133
added
type/3.1 cherry-pick
type/enhancement
The issue or PR belongs to an enhancement.
priority/release-blocker
This issue blocks a release. Please solve it ASAP.
labels
Nov 8, 2019
crazycs520
reviewed
Nov 8, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bb7133
force-pushed
the
bb7133/cp-12179-3.1
branch
2 times, most recently
from
November 10, 2019 15:04
8d4989e
to
1264222
Compare
bb7133
force-pushed
the
bb7133/cp-12179-3.1
branch
from
November 11, 2019 08:40
ee04854
to
9d01e93
Compare
/run-all-tests |
/run-unit-test |
djshow832
reviewed
Nov 11, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Approve |
ngaut
approved these changes
Nov 11, 2019
ngaut
added
the
status/can-merge
Indicates a PR has been approved by a committer.
label
Nov 11, 2019
/run-all-tests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
priority/release-blocker
This issue blocks a release. Please solve it ASAP.
status/can-merge
Indicates a PR has been approved by a committer.
status/LGT2
Indicates that a PR has LGTM 2.
type/enhancement
The issue or PR belongs to an enhancement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Backport #12179 by cherry-picking #12808
Conflict files(from #12808):
Related Parser PR: pingcap/parser#629
What problem does this PR solve?
slow-log-plan
config item and system variable to control enable.tidb_decode_plan
function to decode the ecoded plan string.Plan
column toSlow_query
table.Related PR: pingcap/parser#557
Example
Enable
tidb_record_plan_in_slow_log
first.In slow log
As is seen,
Plan
is the string of the encoded query plan.query the
slow_query
tableUse
tidb_decode_plan
function to decode the encoded plan string.What is changed and how it works?
planEncoder
andplanDecoder
.snappy
to compress the string.base64
encode.The performance of
snappy
is good thanzlib
.Benchmark test
Related PR:
Set
tidb_slow_threshold
to 0 then do benchmark test.As you can see, It only has a minimal impact on performance when record plan in the slow log.
Before
This PR
Check List
Tests
Code changes