-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: log each com_stmt_fetch
separately
#11987
Conversation
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #11987 +/- ##
==========================================
Coverage ? 80.745%
==========================================
Files ? 454
Lines ? 99403
Branches ? 0
==========================================
Hits ? 80263
Misses ? 13346
Partials ? 5794 |
IMO, I don't like this way to fix the slow query misinformation (the extra |
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
mysql record slow log for each comand time, should keep compatible with that? |
|
||
// LogPartialSlow logs the slow log for partial result. | ||
// it will be used in server-side cursor or multi-queries. | ||
LogPartialSlow() |
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.
The method name is too specific.
Something like OnFetchDone
would be better.
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.
I tried remove this method out of that interface and give a new name now~ PTAL if free
/run-all-tests |
@coocood @tiancaiamao PTAL |
LGTM |
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
/run-all-tests |
cherry pick to release-3.1 failed |
cherry pick to release-3.0 in PR #12392 |
What problem does this PR solve?
to slow log:
In the current master code, slow log will be wrong value(
last fetch time(or new start execute time) - last cmd time
)In 2.1 code, slow log will be incompatible value(
last fetch time(or new start execute time) - first com_stmt_execute
time)but mysql record com_stmt_exec and com_stmt_fetch for each request.
this pr will change the behavior as MySQL does, although TiDB and MySQL use very different way to handle cursor:
so, you may see mysql stmt_execute is slow but fetch super fast, and TiDB both execute and fetch is slow in log.
What is changed and how it works?
InPreapre
andHasMoreResult
in slow log too(help find question)Parse_time
andCompile_time
in slow log(it seems miss those two fields)Check List
Tests
Code changes
Side effects
Related changes
tidb-ansible
repositoryRelease note
This change is