-
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
statistics: avoid using infoschema when to init stats #54514
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54514 +/- ##
================================================
+ Coverage 73.4625% 77.5396% +4.0770%
================================================
Files 1605 1649 +44
Lines 445096 473612 +28516
================================================
+ Hits 326979 367237 +40258
+ Misses 98081 84994 -13087
- Partials 20036 21381 +1345
Flags with carried forward coverage won't be shown. Click here to find out more.
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
c44c3fa
to
afa34ce
Compare
/retest |
1 similar comment
/retest |
76c1bab
to
31185a7
Compare
/retest |
31185a7
to
5948fde
Compare
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
76d5f83
to
2470e5e
Compare
@@ -508,46 +508,6 @@ func TestIssue44369(t *testing.T) { | |||
tk.MustExec("select * from t where a = 10 and bb > 20;") | |||
} | |||
|
|||
// Test the case that after ALTER TABLE happens, the pointer to the column info/index info should be refreshed. | |||
func TestColAndIdxExistenceMapChangedAfterAlterTable(t *testing.T) { |
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.
No table info in the stats. so we don't need to test for it.
/retest |
1 similar comment
/retest |
Signed-off-by: Weizhen Wang <[email protected]>
/retest |
1 similar comment
/retest |
|
||
// Detect the context cancel signal, since it may take a long time for the loop. | ||
// TODO: add context to TableInfoByID and remove this code block? | ||
if ctx.Err() != nil { |
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.
This line is important, why remove it?
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.
Because we don't need to read meta. so we can remove this code.
// Now, we cannot init the column info in the ColAndIdxExistenceMap when to disable lite-init-stats. | ||
// so we have to get the column info from the domain. | ||
is := sctx.GetDomainInfoSchema().(infoschema.InfoSchema) | ||
tblInfo, ok := statsHandle.TableInfoByID(is, col.TableID) |
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.
What's the difference... it's still calling TableInfoByID?
How could this avoid using infoschema when init stats
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.
In this context, stats are loaded only for the tables that require statistical information, thereby avoiding a full load meta.
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
/retest |
1 similar comment
/retest |
[LGTM Timeline notifier]Timeline:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lance6716, tiancaiamao, winoros 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 |
What problem does this PR solve?
Issue Number: close #55851
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.