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

PS-1344: Rearrange checks in log_slow_statement() function (5.7) #4396

Merged
merged 1 commit into from
Jul 16, 2021

Conversation

oleksandr-kachan
Copy link
Contributor

@oleksandr-kachan oleksandr-kachan commented Jul 7, 2021

https://jira.percona.com/browse/PS-1344

Rearrange PS specific checks in log_slow_statement() function:

  • Check state of thd->enable_slow_log before doing a bunch
    of PS specific checks. This allows to find out if slow log is
    enabled early and avoid unnecessary checks.
  • Move collecting of query_exec_time up, do it right after
    thd->enable_slow_log is checked. Getting query_exec_time earlier
    before performing PS speciffic checks will give a more precise
    duration.
  • Copy global vars into session ones before doing checks where this
    value is actually used, do it as the next step after query_exec_time
    calculation.

@oleksandr-kachan
Copy link
Contributor Author

@oleksandr-kachan oleksandr-kachan changed the title PS-1344: Rearrange checks in log_slow_statement() function PS-1344: Rearrange checks in log_slow_statement() function (5.7) Jul 9, 2021
Copy link
Contributor

@satya-bodapati satya-bodapati left a comment

Choose a reason for hiding this comment

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

Is this pure refactoring? Can you please list the effects of your changes in the commit/github description? I mean "move here to there" type messages do not really convey what you achieved.

https://jira.percona.com/browse/PS-1344

Rearrange PS specific checks in log_slow_statement() function:
- Check state of thd->enable_slow_log before doing a bunch
  of PS specific checks. This allows to find out if slow log is
  enabled early and avoid unnecessary checks.
- Move collecting of query_exec_time up, do it right after
  thd->enable_slow_log is checked. Getting query_exec_time earlier
  before performing PS speciffic checks will give a more precise
  duration.
- Copy global vars into session ones before doing checks where this
  value is actually used, do it as the next step after query_exec_time
  calculation.
@oleksandr-kachan
Copy link
Contributor Author

Is this pure refactoring? Can you please list the effects of your changes in the commit/github description? I mean "move here to there" type messages do not really convey what you achieved.

Yes, this is just a refactoring. I've extended description a bit, not sure there is anything more to be added there.

@satya-bodapati
Copy link
Contributor

Is this pure refactoring? Can you please list the effects of your changes in the commit/github description? I mean "move here to there" type messages do not really convey what you achieved.

Yes, this is just a refactoring. I've extended description a bit, not sure there is anything more to be added there.

Ok, if it is refactoring, then it is fine. It looked like it could result in some improvements.

@oleksandr-kachan oleksandr-kachan merged commit 5ce4f5f into percona:5.7 Jul 16, 2021
@oleksandr-kachan oleksandr-kachan deleted the PS-1344-5.7 branch July 16, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants