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

executor, util: improve concurrency of statement summary(#14490) #14627

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

djshow832
Copy link
Contributor

Conflicting files:
util/stmtsummary/statement_summary.go

What problem does this PR solve?

Improve the performance in point get.
In point_get of wide_table_200, QPS decreases from 59k to 49k (refer to issue #14432). Because there're too many kinds of summaries to fit in the cache, creating a new summary needs to lock the cache, so much time is spent on waiting for the lock.
Also, some time is spent on generating digest.

After this PR, QPS increases back to 57k.

What is changed and how it works?

  • Move some calculation out of cache lock to decrease lock contention.
  • If it's a point_get, only generate digest once.

Check List

Tests

  • Unit test

Code changes

N/A

Side effects

  • Increased code complexity

Related changes

N/A

Release note

  • Improve concurrency of statement summary by decreasing lock contention.

@djshow832 djshow832 added type/enhancement The issue or PR belongs to an enhancement. type/performance type/3.0 cherry-pick labels Feb 4, 2020
@djshow832
Copy link
Contributor Author

/rebuild

@djshow832 djshow832 force-pushed the cherry-pick_14490_3.0 branch from 1db79ce to 43105cb Compare February 4, 2020 14:40
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133 bb7133 added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Feb 5, 2020
@bb7133 bb7133 added this to the v3.0.10 milestone Feb 5, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 5, 2020

/run-all-tests

@jackysp
Copy link
Member

jackysp commented Feb 5, 2020

/merge

@sre-bot sre-bot merged commit ac3f7f7 into pingcap:release-3.0 Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. type/performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants