-
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
planner: optimize performance of IndexUsage
utilities (#53195)
#53215
planner: optimize performance of IndexUsage
utilities (#53195)
#53215
Conversation
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-8.1 #53215 +/- ##
================================================
Coverage ? 71.2724%
================================================
Files ? 1465
Lines ? 421863
Branches ? 0
================================================
Hits ? 300672
Misses ? 100761
Partials ? 20430
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, YangKeao The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
This is an automated cherry-pick of #53195
What problem does this PR solve?
Issue Number: close #51898
Problem Summary:
This PR is trying to optimize the performance of
IndexUsage
utilities. Previously it costed around 1% CPU and did a lot of allocation. This PR tries to optimize it and get some tiny performance boost.What changed and how does it work?
indexUsage
and the internal entries.getTblInfoForUsedStatsByPhysicalID
, which is very slow because it iterates over all tables.Check List
Tests
I used https://gist.github.com/YangKeao/c02ada99d2602d5e7fb5fb94f0581015 to run a stabler
select_random_points
benchmark. It gives QPS 59029 and 58393 for the commit before index usage and with index usage enabled.After patching the index usage commit with this PR, the average QPS goes to 58854. I'm not sure whether there are other spaces to improve the performance (like improving the speed of loading stats).
As a reference: the flamegraph before this PR:
The flamegraph after this PR:
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.